From c06078fccb38587dd95e3f23e7cb34f34eeabb6a Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Sat, 17 Sep 2022 18:06:02 +0200 Subject: [PATCH] fix ratecontroller vec access --- src/ratecontroller.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ratecontroller.rs b/src/ratecontroller.rs index 20b2d30..e5fc775 100644 --- a/src/ratecontroller.rs +++ b/src/ratecontroller.rs @@ -186,8 +186,8 @@ impl Ratecontroller { down_deltas.sort_by(|a, b| a.partial_cmp(b).unwrap()); up_deltas.sort_by(|a, b| a.partial_cmp(b).unwrap()); - down_delta_stat = Utils::a_else_b(down_deltas[3], down_deltas[1]); - up_delta_stat = Utils::a_else_b(up_deltas[3], up_deltas[1]); + down_delta_stat = Utils::a_else_b(down_deltas[2], down_deltas[0]); + up_delta_stat = Utils::a_else_b(up_deltas[2], up_deltas[0]); if down_delta_stat > 0.0 && up_delta_stat > 0.0 { /*