Commit 23568fce authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 66c20069
......@@ -266,17 +266,31 @@ func (rbs RBucketSet) Get(k Key) *RBucket {
return rbs[i].hi > k
})
if i == len(rbs) {
panic(fmt.Sprintf("BUG: key %v not covered", k))
panic(fmt.Sprintf("BUG: key %v not covered; coverage: %s", k, rbs.coverage()))
}
rb := rbs[i]
if !(rb.lo <= k && k < rb.hi) {
panic(fmt.Sprintf("BUG: get(%v) -> [%v, %v)", k, rb.lo, rb.hi))
panic(fmt.Sprintf("BUG: get(%v) -> [%v, %v); coverage: %s", k, rb.lo, rb.hi, rbs.coverage()))
}
return rb
}
func (rbs RBucketSet) coverage() string {
if len(rbs) == 0 {
return "ø"
}
s := ""
for _, rb := range rbs {
if s != "" {
s += " "
}
s += fmt.Sprintf("[%v, %v)", rb.lo, rb.hi)
}
return s
}
// XGetTree loads Tree from zurl@at->obj<root>.
......
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