Skip to content

Commit

Permalink
Merge pull request #3230 from lucas-clemente/optimize-has-outstanding…
Browse files Browse the repository at this point in the history
…-crypto-packets

optimize hasOutstandingCryptoPackets in sentPacketHandler
  • Loading branch information
marten-seemann committed Jul 25, 2021
2 parents 61ad941 + 6279d6b commit 8906148
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions internal/ackhandler/sent_packet_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8906148

Please sign in to comment.