Skip to content

Commit cdf534b

Browse files
fjlcuiweixie
authored andcommitted
Update msgrate.go
1 parent 888d4b7 commit cdf534b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

p2p/msgrate/msgrate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func (t *Tracker) Capacity(kind uint64, targetRTT time.Duration) int {
171171
// roundCapacity gives the integer value of a capacity.
172172
// The result fits int32, and is guaranteed to be positive.
173173
func roundCapacity(cap float64) int {
174-
return int(math.Min(math.MaxInt32, math.Max(1, math.Ceil(cap))))
174+
return int(min(math.MaxInt32, max(1, math.Ceil(cap))))
175175
}
176176

177177
// Update modifies the peer's capacity values for a specific data type with a new

0 commit comments

Comments
 (0)