refactor RTT measurements to simplify the sentPacketHistory

This commit is contained in:
Marten Seemann
2020-09-06 14:16:11 +07:00
parent bed802aee5
commit c7af1dc045
3 changed files with 19 additions and 37 deletions

View File

@@ -23,13 +23,6 @@ func (h *sentPacketHistory) SentPacket(p *Packet) {
h.packetMap[p.PacketNumber] = el
}
func (h *sentPacketHistory) GetPacket(p protocol.PacketNumber) *Packet {
if el, ok := h.packetMap[p]; ok {
return &el.Value
}
return nil
}
// Iterate iterates through all packets.
// The callback must not modify the history.
func (h *sentPacketHistory) Iterate(cb func(*Packet) (cont bool, err error)) error {