Commit b0e11199 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b1fffe1f
......@@ -398,9 +398,7 @@ func (S RangedKeySet) String() string {
}
func (r KeyRange) String() string {
slo := "-∞"; if r.lo > KeyMin { slo = fmt.Sprintf("%v", r.lo) }
shi := "∞"; if r.hi_ < KeyMax { shi = fmt.Sprintf("%v", r.hi_+1) }
return fmt.Sprintf("[%s,%s)", slo, shi)
return fmt.Sprintf("[%s,%s)", keyStr(slo), keyStr(shi))
}
......
......@@ -987,10 +987,8 @@ func xidOf(obj zodb.IPersistent) string {
}
func (rn nodeInRange) String() string {
slo := "-∞"; if rn.lo > KeyMin { slo = fmt.Sprintf("%v", rn.lo) }
shi := "∞"; if rn.hi_ < KeyMax { shi = fmt.Sprintf("%v", rn.hi_+1) }
done := " "; if rn.done { done = "*" }
return fmt.Sprintf("%s[%s,%s)%s", done, slo, shi, vnode(rn.node))
return fmt.Sprintf("%s[%s,%s)%s", done, keyStr(slo), keyStr(shi), vnode(rn.node))
}
// push pushes element to node stack.
......
......@@ -68,3 +68,15 @@ func nodePathToPath(nodePath []Node) (path []zodb.Oid) {
}
return path
}
// keyStr formats key as string.
func keyStr(k Key) string {
if k == KeyMin {
return "-∞"
}
if k == KeyMax {
return "∞"
}
return fmt.Sprintf("%d", k)
}
......@@ -1995,9 +1995,7 @@ func sortedKeys(kv map[Key]Δstring) []Key {
func (b *RBucket) String() string {
// XXX dup wrt nodeInRange.String
slo := "-∞"; if b.lo > KeyMin { slo = fmt.Sprintf("%v", b.lo) }
shi := "∞"; if b.hi_ < KeyMax { shi = fmt.Sprintf("%v", b.hi_+1) }
return fmt.Sprintf("[%s,%s)B%s{%s}", slo, shi, b.oid, kvtxt(b.kv))
return fmt.Sprintf("[%s,%s)B%s{%s}", keyStr(slo), keyStr(shi), b.oid, kvtxt(b.kv))
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment