Skip to content

Commit

Permalink
make sure offset less than size even it's checked inside (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevwan authored Jan 5, 2021
1 parent a79cee1 commit 57b73d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/collection/rollingwindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (rw *RollingWindow) updateOffset() {
offset := rw.offset
// reset expired buckets
for i := 0; i < span; i++ {
rw.win.resetBucket(offset + i + 1)
rw.win.resetBucket((offset + i + 1) % rw.size)
}

rw.offset = (offset + span) % rw.size
Expand Down

0 comments on commit 57b73d8

Please sign in to comment.