Use extend instead of repeatedly pushing into a vec
This commit is contained in:
parent
7e7d007467
commit
fadae872fa
1 changed files with 4 additions and 4 deletions
|
@ -352,15 +352,15 @@ fn save_unreachable_coverage(
|
||||||
}
|
}
|
||||||
|
|
||||||
let start_block = &mut basic_blocks[START_BLOCK];
|
let start_block = &mut basic_blocks[START_BLOCK];
|
||||||
for (source_info, code_region) in dropped_coverage {
|
start_block.statements.extend(dropped_coverage.into_iter().map(
|
||||||
start_block.statements.push(Statement {
|
|(source_info, code_region)| Statement {
|
||||||
source_info,
|
source_info,
|
||||||
kind: StatementKind::Coverage(Box::new(Coverage {
|
kind: StatementKind::Coverage(Box::new(Coverage {
|
||||||
kind: CoverageKind::Unreachable,
|
kind: CoverageKind::Unreachable,
|
||||||
code_region: Some(code_region),
|
code_region: Some(code_region),
|
||||||
})),
|
})),
|
||||||
})
|
},
|
||||||
}
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SimplifyLocals;
|
pub struct SimplifyLocals;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue