From 06ad31a04e1556dc94bf06c5c1b61666c35a0fa6 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sun, 31 Mar 2024 23:44:50 +0200 Subject: [PATCH] Use Vec::with_capacity in NoiseModel::new --- src/diff/solver.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diff/solver.rs b/src/diff/solver.rs index 2c92b62..4697a52 100644 --- a/src/diff/solver.rs +++ b/src/diff/solver.rs @@ -374,7 +374,7 @@ impl NoiseModel { NoiseModelState::new(n + 1), NoiseModelState::new(n + 1), ]; - let mut coords = Vec::new(); + let mut coords = Vec::with_capacity(n); let neg_lag = -(NOISE_MODEL_LAG as isize); for y in neg_lag..=0 {