Update garray_sorted_any.go

bugfix: avoid overflow
This commit is contained in:
None
2020-11-05 22:37:36 +08:00
committed by GitHub
parent 176dcdc7cc
commit ed4a70deff

View File

@ -446,7 +446,7 @@ func (a *SortedArray) binSearch(value interface{}, lock bool) (index int, result
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: