implement generic Min and Max functions

This commit is contained in:
Marten Seemann 2022-07-25 16:10:36 -04:00
parent 424325af58
commit 43bde14cf7
28 changed files with 103 additions and 258 deletions

View file

@ -72,5 +72,5 @@ func (p *skippingPacketNumberGenerator) Pop() protocol.PacketNumber {
func (p *skippingPacketNumberGenerator) generateNewSkip() {
// make sure that there are never two consecutive packet numbers that are skipped
p.nextToSkip = p.next + 2 + protocol.PacketNumber(p.rng.Int31n(int32(2*p.period)))
p.period = utils.MinPacketNumber(2*p.period, p.maxPeriod)
p.period = utils.Min(2*p.period, p.maxPeriod)
}