mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-11 10:23:29 +02:00
refactor: replace math.Min and math.Max with built-in min/max
Reference: https://github.com/lightningnetwork/lnd/pull/9451#pullrequestreview-2580942691 Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -183,7 +183,7 @@ func randRetryDelay(initialRetryDelay, maxRetryDelay time.Duration,
|
||||
// attempt. If we double something n times, that's the same as
|
||||
// multiplying the value with 2^n. We limit the power to 32 to avoid
|
||||
// overflows.
|
||||
factor := time.Duration(math.Pow(2, math.Min(float64(attempt), 32)))
|
||||
factor := time.Duration(math.Pow(2, min(float64(attempt), 32)))
|
||||
actualDelay := initialDelay * factor
|
||||
|
||||
// Cap the delay at the maximum configured value.
|
||||
|
Reference in New Issue
Block a user