comment cleanup

This commit is contained in:
ModulatingForce 2023-12-20 18:59:08 -05:00
parent 606663731c
commit 64817f463c

View file

@ -25,40 +25,6 @@ impl RateLimiter {
}
}
// pub fn check_limiter(&mut self) -> LimiterResp {
// if self.timer.elapsed().as_secs() >= TIME_THRESHOLD_S {
// // # [x] elapsed >= TIME_THRESHOLD_S
// self.timer = Instant::now();
// self.msgcounter = 0;
// LimiterResp::Allow
// } else if self.msgcounter < MSG_THRESHOLD {
// // # [x] elapsed < TIME_THRESHOLD_S && msgcounter < MSG_THRESHOLD
// LimiterResp::Allow
// // } else if self.msgcounter >= MSG_THRESHOLD {
// } else {
// // # [x] elapsed < TIME_THRESHOLD_S && msgcounter >= MSG_THRESHOLD
// LimiterResp::Skip
// }
// }
// pub fn check_limiter(&self) -> LimiterResp {
// if self.timer.elapsed().as_secs() >= TIME_THRESHOLD_S {
// // # [x] elapsed >= TIME_THRESHOLD_S
// self.timer = Instant::now();
// self.msgcounter = 0;
// LimiterResp::Allow
// } else if self.msgcounter < MSG_THRESHOLD {
// // # [x] elapsed < TIME_THRESHOLD_S && msgcounter < MSG_THRESHOLD
// LimiterResp::Allow
// // } else if self.msgcounter >= MSG_THRESHOLD {
// } else {
// // # [x] elapsed < TIME_THRESHOLD_S && msgcounter >= MSG_THRESHOLD
// LimiterResp::Skip
// }
// }
pub fn check_limiter(&mut self) -> LimiterResp {
if self.timer.elapsed().as_secs() >= TIME_THRESHOLD_S {
@ -76,10 +42,6 @@ pub fn check_limiter(&mut self) -> LimiterResp {
}
}
// pub fn increment_counter(&mut self) -> () {
// self.msgcounter += 1;
// }
pub fn increment_counter(&mut self) -> () {
self.msgcounter += 1;
}