From e9c50ccb565597ae2fc07b38372676d8a450553f Mon Sep 17 00:00:00 2001 From: Ignotus Peverell Date: Thu, 8 Nov 2018 00:40:28 +0000 Subject: [PATCH] Time comparisons are difficult. Or not. --- util/src/rate_counter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/src/rate_counter.rs b/util/src/rate_counter.rs index 3d115dce7..78b1d6ca3 100644 --- a/util/src/rate_counter.rs +++ b/util/src/rate_counter.rs @@ -39,7 +39,7 @@ impl RateCounter { let now_millis = millis_since_epoch(); self.last_min_times.push(now_millis); self.last_min_bytes.push(bytes); - while self.last_min_times.len() > 0 && self.last_min_times[0] > now_millis + 60000 { + while self.last_min_times.len() > 0 && self.last_min_times[0] + 60000 < now_millis { self.last_min_times.remove(0); self.last_min_bytes.remove(0); }