From e1ecb0d05691c6ce22de3dd099a659541b9df6e1 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Sat, 21 Oct 2023 23:21:02 +0200 Subject: [PATCH] fixup: Remove last_added_checksum --- src/network/protocol.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/network/protocol.rs b/src/network/protocol.rs index f94594b..a513365 100644 --- a/src/network/protocol.rs +++ b/src/network/protocol.rs @@ -176,7 +176,6 @@ where // debug desync pub(crate) pending_checksums: VecDeque<(Frame, u128)>, - last_added_checksum_frame: Frame, } impl PartialEq for UdpProtocol { @@ -262,7 +261,6 @@ impl UdpProtocol { // debug desync pending_checksums: VecDeque::new(), - last_added_checksum_frame: NULL_FRAME, } } @@ -710,12 +708,10 @@ impl UdpProtocol { /// Upon receiving a `ChecksumReport`, add it to the checksum history fn on_checksum_report(&mut self, body: &ChecksumReport) { - if self.last_added_checksum_frame < body.frame { - self.pending_checksums - .truncate(MAX_CHECKSUM_HISTORY_SIZE - 1); - self.pending_checksums - .push_front((body.frame, body.checksum)); - } + self.pending_checksums + .truncate(MAX_CHECKSUM_HISTORY_SIZE - 1); + self.pending_checksums + .push_front((body.frame, body.checksum)); } /// Returns the frame of the last received input