Skip to content

Commit

Permalink
Merge pull request Terry-Mao#336 from godchick/master
Browse files Browse the repository at this point in the history
fix timer minheap issue
  • Loading branch information
tonybase committed Dec 4, 2020
2 parents a894250 + 504e4a3 commit 25afc58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/time/timer.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func (t *Timer) expire() {
func (t *Timer) up(j int) {
for {
i := (j - 1) / 2 // parent
if i <= j || !t.less(j, i) {
if i >= j || !t.less(j, i) {
break
}
t.swap(i, j)
Expand Down

0 comments on commit 25afc58

Please sign in to comment.