Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/gogf/gf
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn committed Nov 12, 2020
2 parents 9cca3a3 + 97bcf2a commit f8ab71e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion container/garray/garray_sorted_any.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion container/garray/garray_sorted_int.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion container/garray/garray_sorted_str.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ func (a *SortedStrArray) binSearch(value string, lock bool) (index int, result i
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:
Expand Down
2 changes: 1 addition & 1 deletion container/gtree/gtree_btree.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion os/gtimer/gtimer_timer.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (t *Timer) binSearchIndex(n int64) (index int, result int) {
mid := 0
cmp := -2
for min <= max {
mid = int((min + max) / 2)
mid = min + int((max-min)/2)
switch {
case t.wheels[mid].intervalMs == n:
cmp = 0
Expand Down

0 comments on commit f8ab71e

Please sign in to comment.