mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 07:37:20 +00:00
p2p: using math.MaxInt32 from go std lib (#32357)
Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
parent
bf8f63dcd2
commit
997dff4fae
1 changed files with 1 additions and 2 deletions
|
|
@ -171,8 +171,7 @@ func (t *Tracker) Capacity(kind uint64, targetRTT time.Duration) int {
|
|||
// roundCapacity gives the integer value of a capacity.
|
||||
// The result fits int32, and is guaranteed to be positive.
|
||||
func roundCapacity(cap float64) int {
|
||||
const maxInt32 = float64(1<<31 - 1)
|
||||
return int(math.Min(maxInt32, math.Max(1, math.Ceil(cap))))
|
||||
return int(min(math.MaxInt32, max(1, math.Ceil(cap))))
|
||||
}
|
||||
|
||||
// Update modifies the peer's capacity values for a specific data type with a new
|
||||
|
|
|
|||
Loading…
Reference in a new issue