Skip to content

Commit 4625fe0

Browse files
committed
Remove dead arguments
1 parent a238f0d commit 4625fe0

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

quinn-proto/src/connection/mod.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ impl Connection {
14931493
// Notify ack frequency that a packet was acked, because it might contain an ACK_FREQUENCY frame
14941494
self.ack_frequency.on_acked(packet);
14951495

1496-
self.on_packet_acked(now, packet, info);
1496+
self.on_packet_acked(now, info);
14971497
}
14981498
}
14991499

@@ -1579,8 +1579,8 @@ impl Connection {
15791579

15801580
// Not timing-aware, so it's safe to call this for inferred acks, such as arise from
15811581
// high-latency handshakes
1582-
fn on_packet_acked(&mut self, now: Instant, pn: u64, info: SentPacket) {
1583-
self.remove_in_flight(pn, &info);
1582+
fn on_packet_acked(&mut self, now: Instant, info: SentPacket) {
1583+
self.remove_in_flight(&info);
15841584
if info.ack_eliciting && self.path.challenge.is_none() {
15851585
// Only pass ACKs to the congestion controller if we are not validating the current
15861586
// path, so as to ignore any ACKs from older paths still coming in.
@@ -1751,7 +1751,7 @@ impl Connection {
17511751
now,
17521752
self.orig_rem_cid,
17531753
);
1754-
self.remove_in_flight(packet, &info);
1754+
self.remove_in_flight(&info);
17551755
for frame in info.stream_frames {
17561756
self.streams.retransmit(frame);
17571757
}
@@ -1786,7 +1786,7 @@ impl Connection {
17861786
// Handle a lost MTU probe
17871787
if let Some(packet) = lost_mtu_probe {
17881788
let info = self.spaces[SpaceId::Data].take(packet).unwrap(); // safe: lost_mtu_probe is omitted from lost_packets, and therefore must not have been removed yet
1789-
self.remove_in_flight(packet, &info);
1789+
self.remove_in_flight(&info);
17901790
self.path.mtud.on_probe_lost();
17911791
self.stats.path.lost_plpmtud_probes += 1;
17921792
}
@@ -2189,8 +2189,8 @@ impl Connection {
21892189
space.time_of_last_ack_eliciting_packet = None;
21902190
space.loss_time = None;
21912191
let sent_packets = mem::take(&mut space.sent_packets);
2192-
for (pn, packet) in sent_packets.into_iter() {
2193-
self.remove_in_flight(pn, &packet);
2192+
for packet in sent_packets.into_values() {
2193+
self.remove_in_flight(&packet);
21942194
}
21952195
self.set_loss_detection_timer(now)
21962196
}
@@ -2474,7 +2474,7 @@ impl Connection {
24742474

24752475
let space = &mut self.spaces[SpaceId::Initial];
24762476
if let Some(info) = space.take(0) {
2477-
self.on_packet_acked(now, 0, info);
2477+
self.on_packet_acked(now, info);
24782478
};
24792479

24802480
self.discard_space(now, SpaceId::Initial); // Make sure we clean up after any retransmitted Initials
@@ -2494,8 +2494,8 @@ impl Connection {
24942494

24952495
// Retransmit all 0-RTT data
24962496
let zero_rtt = mem::take(&mut self.spaces[SpaceId::Data].sent_packets);
2497-
for (pn, info) in zero_rtt {
2498-
self.remove_in_flight(pn, &info);
2497+
for info in zero_rtt.into_values() {
2498+
self.remove_in_flight(&info);
24992499
self.spaces[SpaceId::Data].pending |= info.retransmits;
25002500
}
25012501
self.streams.retransmit_all_for_0rtt();
@@ -2560,8 +2560,8 @@ impl Connection {
25602560
// Discard 0-RTT packets
25612561
let sent_packets =
25622562
mem::take(&mut self.spaces[SpaceId::Data].sent_packets);
2563-
for (pn, packet) in sent_packets {
2564-
self.remove_in_flight(pn, &packet);
2563+
for packet in sent_packets.into_values() {
2564+
self.remove_in_flight(&packet);
25652565
}
25662566
} else {
25672567
self.accepted_0rtt = true;
@@ -3679,13 +3679,13 @@ impl Connection {
36793679
}
36803680

36813681
/// Update counters to account for a packet becoming acknowledged, lost, or abandoned
3682-
fn remove_in_flight(&mut self, pn: u64, packet: &SentPacket) {
3683-
// Visit known paths from newest to oldest to find the one `pn` was sent on
3682+
fn remove_in_flight(&mut self, packet: &SentPacket) {
3683+
// Visit known paths from newest to oldest to find the one `packet` was sent on
36843684
for path in [&mut self.path]
36853685
.into_iter()
36863686
.chain(self.prev_path.as_mut().map(|(_, data)| data))
36873687
{
3688-
if path.remove_in_flight(pn, packet) {
3688+
if path.remove_in_flight(packet) {
36893689
return;
36903690
}
36913691
}

quinn-proto/src/connection/paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl PathData {
170170

171171
/// Remove `packet` with number `pn` from this path's congestion control counters, or return
172172
/// `false` if `pn` was sent before this path was established.
173-
pub(super) fn remove_in_flight(&mut self, pn: u64, packet: &SentPacket) -> bool {
173+
pub(super) fn remove_in_flight(&mut self, packet: &SentPacket) -> bool {
174174
if packet.path_generation != self.generation {
175175
return false;
176176
}

0 commit comments

Comments
 (0)