use pointer args

This commit is contained in:
Daniel Eades 2022-12-30 08:25:39 +00:00
parent ed128872eb
commit 7530d76f00
3 changed files with 3 additions and 3 deletions

View file

@ -100,7 +100,7 @@ impl Round {
self.linear = rmse < 0.05 && max_error < 0.1 && a > -0.1;
fn normalize(xs: &mut Vec<f64>) {
fn normalize(xs: &mut [f64]) {
let max = xs.iter().copied().max_by(|a, b| a.partial_cmp(b).unwrap()).unwrap();
xs.iter_mut().for_each(|it| *it /= max);
}