mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-12 14:27:28 +01:00
use a with_capacity while allocating the progress view
This commit is contained in:
parent
ab9213fa94
commit
75d5cea624
@ -37,7 +37,7 @@ impl Progress {
|
|||||||
let mut percentage = 0.0;
|
let mut percentage = 0.0;
|
||||||
let mut prev_factors = 1.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() {
|
for (_, step) in steps.iter() {
|
||||||
prev_factors *= step.total() as f32;
|
prev_factors *= step.total() as f32;
|
||||||
percentage += step.current() as f32 / prev_factors;
|
percentage += step.current() as f32 / prev_factors;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user