utils: switch to standard library min and max functions (#4218)

These functions were added in Go 1.21.
This commit is contained in:
Marten Seemann 2023-12-28 12:19:13 +07:00 committed by GitHub
parent 18c591c75a
commit 22411e16d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 44 additions and 78 deletions

View file

@ -294,7 +294,7 @@ func (p *TransportParameters) readNumericTransportParameter(
return fmt.Errorf("initial_max_streams_uni too large: %d (maximum %d)", p.MaxUniStreamNum, protocol.MaxStreamCount)
}
case maxIdleTimeoutParameterID:
p.MaxIdleTimeout = utils.Max(protocol.MinRemoteIdleTimeout, time.Duration(val)*time.Millisecond)
p.MaxIdleTimeout = max(protocol.MinRemoteIdleTimeout, time.Duration(val)*time.Millisecond)
case maxUDPPayloadSizeParameterID:
if val < 1200 {
return fmt.Errorf("invalid value for max_packet_size: %d (minimum 1200)", val)