From bcb3a76c122f16e9d43491b1f944fed10449f3c5 Mon Sep 17 00:00:00 2001 From: Hennadii Chernyshchyk Date: Wed, 20 Nov 2024 00:21:01 +0200 Subject: [PATCH] Put extra logic for `ConfirmHistory::confirm` under else The bit is set in `set_last_tick`, no need to call `set` after it. --- src/client/confirm_history.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/confirm_history.rs b/src/client/confirm_history.rs index cbf44f0d..3d974612 100644 --- a/src/client/confirm_history.rs +++ b/src/client/confirm_history.rs @@ -90,10 +90,11 @@ impl ConfirmHistory { pub fn confirm(&mut self, tick: RepliconTick) { if tick > self.last_tick { self.set_last_tick(tick); - } - let ago = self.last_tick - tick; - if ago < u64::BITS { - self.set(ago); + } else { + let ago = self.last_tick - tick; + if ago < u64::BITS { + self.set(ago); + } } }