Skip to content

Commit

Permalink
Return uint64 from exponentBase2 function (#753)
Browse files Browse the repository at this point in the history
A 32bit binary could not be built because `1 << 62` would overflow the
return `uint` type, as it is an architecture dependent type.

Closes #752
  • Loading branch information
fesiqueira authored Feb 26, 2025
1 parent 8ce5e42 commit 8b26373
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion interceptors/retry/backoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func jitterUp(duration time.Duration, jitter float64) time.Duration {

// exponentBase2 computes 2^(a-1) where a >= 1. If a is 0, the result is 1.
// if a is greater than 62, the result is 2^62 to avoid overflowing int64
func exponentBase2(a uint) uint {
func exponentBase2(a uint) uint64 {
if a == 0 {
return 1
}
Expand Down

0 comments on commit 8b26373

Please sign in to comment.