move util functions into respective modules
This commit is contained in:
1 parent
1c38d8ff48
commit
befccc0d6f
4 files changed
+11
-20
No files matched your search
@@ -1,6 +1,5 @@
|
||||
use crate::clock::Clock;
|
||||
use crate::netlink::{Netlink, NetlinkError, Qdisc};
|
||||
use crate::utils::Utils;
|
||||
use crate::{Config, ReflectorStats};
|
||||
use log::{debug, error, info, warn};
|
||||
use rand::seq::SliceRandom;
|
||||
@@ -120,7 +119,11 @@ impl Ratecontroller {
|
||||
if state.deltas.len() < 3 {
|
||||
state.next_rate = min_rate;
|
||||
} else {
|
||||
state.delta_stat = Utils::a_else_b(state.deltas[2], state.deltas[0]);
|
||||
state.delta_stat = if state.deltas[2] > 0.0 {
|
||||
state.deltas[2]
|
||||
} else {
|
||||
state.deltas[0]
|
||||
};
|
||||
|
||||
if state.delta_stat > 0.0 {
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user