Merge pull request #3230 from lucas-clemente/optimize-has-outstanding-crypto-packets

optimize hasOutstandingCryptoPackets in sentPacketHandler
This commit is contained in:
Marten Seemann 2021-07-25 19:40:18 +02:00 committed by GitHub
commit 8906148682
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -483,14 +483,13 @@ func (h *sentPacketHandler) getPTOTimeAndSpace() (pto time.Time, encLevel protoc
}
func (h *sentPacketHandler) hasOutstandingCryptoPackets() bool {
var hasInitial, hasHandshake bool
if h.initialPackets != nil {
hasInitial = h.initialPackets.history.HasOutstandingPackets()
if h.initialPackets != nil && h.initialPackets.history.HasOutstandingPackets() {
return true
}
if h.handshakePackets != nil {
hasHandshake = h.handshakePackets.history.HasOutstandingPackets()
if h.handshakePackets != nil && h.handshakePackets.history.HasOutstandingPackets() {
return true
}
return hasInitial || hasHandshake
return false
}
func (h *sentPacketHandler) hasOutstandingPackets() bool {