Update garray_sorted_int.go

bugfix: avoid overflow
This commit is contained in:
None
2020-11-05 22:41:43 +08:00
committed by GitHub
parent 176dcdc7cc
commit 784abf2a30

View File

@ -443,7 +443,7 @@ func (a *SortedIntArray) binSearch(value int, lock bool) (index int, result int)
mid := 0
cmp := -2
for min <= max {
mid = (min + max) / 2
mid = min + int((max-min)/2)
cmp = a.getComparator()(value, a.array[mid])
switch {
case cmp < 0: