Skip to content

Commit

Permalink
fix: tests on 32bit arch (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
creekorful committed May 4, 2022
1 parent 132186d commit 07d2d56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ratelimit/bucketset.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ func (tbs *TokenBucketSet) GetMaxPeriod() time.Duration {
// debugState returns string that reflects the current state of all buckets in
// this set. It is intended to be used for debugging and testing only.
func (tbs *TokenBucketSet) debugState() string {
periods := sort.IntSlice(make([]int, 0, len(tbs.buckets)))
periods := make([]int64, 0, len(tbs.buckets))
for period := range tbs.buckets {
periods = append(periods, int(period))
periods = append(periods, int64(period))
}
sort.Sort(periods)
sort.Slice(periods, func(i, j int) bool { return periods[i] < periods[j] })
bucketRepr := make([]string, 0, len(tbs.buckets))
for _, period := range periods {
bucket := tbs.buckets[time.Duration(period)]
Expand Down

0 comments on commit 07d2d56

Please sign in to comment.