Skip to content

Commit

Permalink
Fix integer overflow on 32-bit platform
Browse files Browse the repository at this point in the history
  • Loading branch information
kb2ma committed Jul 19, 2021
1 parent e48a6ef commit ac90d74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/stat/base/leap_array.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewAtomicBucketWrapArrayWithTime(len int, bucketLengthInMs uint32, now uint
}

timeId := now / uint64(bucketLengthInMs)
idx := int(timeId) % len
idx := int(timeId % uint64(len))
startTime := calculateStartTime(now, bucketLengthInMs)

for i := idx; i <= len-1; i++ {
Expand Down

0 comments on commit ac90d74

Please sign in to comment.