Skip to content

Commit

Permalink
pref: Allocate rows and values with fixed size
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrDeveloper committed Mar 3, 2024
1 parent 6125c30 commit 29ef5e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/data_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ impl DataProvider for FileDataProvider {
}
}

let mut rows: Vec<Row> = vec![];
let mut rows: Vec<Row> = Vec::with_capacity(files.len());

let names_len = fields_names.len() as i64;
let values_len = fields_values.len() as i64;
let padding = names_len - values_len;

for file in files {
let mut values: Vec<Value> = vec![];
let mut values: Vec<Value> = Vec::with_capacity(names_len as usize);
let path = Path::new(&file);

for index in 0..names_len {
Expand Down

0 comments on commit 29ef5e1

Please sign in to comment.