Use Vec extend instead of repeated pushes in several places
This commit is contained in:
parent
e6b883c74f
commit
883d0a7aa5
5 changed files with 6 additions and 16 deletions
|
@ -329,9 +329,7 @@ impl<'a, 'tcx> CoverageSpans<'a, 'tcx> {
|
|||
fn mir_to_initial_sorted_coverage_spans(&self) -> Vec<CoverageSpan> {
|
||||
let mut initial_spans = Vec::<CoverageSpan>::with_capacity(self.mir_body.num_nodes() * 2);
|
||||
for (bcb, bcb_data) in self.basic_coverage_blocks.iter_enumerated() {
|
||||
for coverage_span in self.bcb_to_initial_coverage_spans(bcb, bcb_data) {
|
||||
initial_spans.push(coverage_span);
|
||||
}
|
||||
initial_spans.extend(self.bcb_to_initial_coverage_spans(bcb, bcb_data));
|
||||
}
|
||||
|
||||
if initial_spans.is_empty() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue