coverage: Reserve capacity for all of a function's mapping regions

We already know in advance how many entries will be pushed onto this vector.
This commit is contained in:
Zalathar 2023-09-03 16:22:06 +10:00
parent 4f88aa0fbd
commit fbbb543ced

View File

@ -171,7 +171,7 @@ fn write_coverage_mapping<'a>(
}
let mut virtual_file_mapping = Vec::new();
let mut mapping_regions = Vec::new();
let mut mapping_regions = Vec::with_capacity(counter_regions.len());
let mut current_file_name = None;
let mut current_file_id = 0;