From 75d5cea62470c17a3341c40f0eeefbcf81590f9d Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 11 Dec 2024 18:17:33 +0100 Subject: [PATCH] use a with_capacity while allocating the progress view --- crates/milli/src/progress.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/milli/src/progress.rs b/crates/milli/src/progress.rs index 3c7a35c89..96483ebd0 100644 --- a/crates/milli/src/progress.rs +++ b/crates/milli/src/progress.rs @@ -37,7 +37,7 @@ impl Progress { let mut percentage = 0.0; let mut prev_factors = 1.0; - let mut step_view = Vec::new(); + let mut step_view = Vec::with_capacity(steps.len()); for (_, step) in steps.iter() { prev_factors *= step.total() as f32; percentage += step.current() as f32 / prev_factors;