Merge pull request #982 from lutherlau/patch-5

Update gtree_btree.go
This commit is contained in:
John Guo
2020-11-12 20:38:51 +08:00
committed by GitHub

View File

@ -620,7 +620,7 @@ func (tree *BTree) middle() int {
func (tree *BTree) search(node *BTreeNode, key interface{}) (index int, found bool) {
low, mid, high := 0, 0, len(node.Entries)-1
for low <= high {
mid = (high + low) / 2
mid = low + int((high-low)/2)
compare := tree.getComparator()(key, node.Entries[mid].Key)
switch {
case compare > 0: