refactor(ratecontrol): Rate calculation uses floor

This commit is contained in:
Nils Andreas Svee committed 2026-02-22 12:13:14 +07:00
1 parent f2113fa11c
commit 5af42c4a22
1 file changed
+2 -2
+2 -2
View File
@@ -153,7 +153,7 @@ impl Ratecontroller {
if state.delta_stat < delay_ms if state.delta_stat < delay_ms
&& state.load > self.config.high_load_level && state.load > self.config.high_load_level
{ {
state.safe_rates[state.nrate] = (state.current_rate * state.load).round(); state.safe_rates[state.nrate] = (state.current_rate * state.load).floor();
let max_rate = state let max_rate = state
.safe_rates .safe_rates
.iter() .iter()
@@ -180,7 +180,7 @@ impl Ratecontroller {
} }
} }
state.next_rate = state.next_rate.max(min_rate).round(); state.next_rate = state.next_rate.max(min_rate).floor();
state.previous_bytes = state.current_bytes; state.previous_bytes = state.current_bytes;
state.prev_t = now_t; state.prev_t = now_t;