This commit is contained in:
Andy Arthur
2022-10-25 14:40:33 -07:00
parent 298e2d3d2e
commit 141aa1c8c0
+1 -1
View File
@@ -329,7 +329,7 @@ func (ti onHeapTableIndex) findPrefix(prefix uint64) (idx uint32) {
h := idx + (j-idx)/2 // avoid overflow when computing h
// i ≤ h < j
o := int64(prefixTupleSize * h)
if bytes.Compare(ti.tupleB[o:o+addrPrefixSize], query) < 1 {
if bytes.Compare(ti.tupleB[o:o+addrPrefixSize], query) < 0 {
idx = h + 1 // preserves f(i-1) == false
} else {
j = h // preserves f(j) == true