Skip to content

Commit ac9e3c4

Browse files
committed
Reserve new_blocks once.
1 parent de70e59 commit ac9e3c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_mir_transform/src/add_call_guards.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl<'tcx> crate::MirPass<'tcx> for AddCallGuards {
8282
}
8383

8484
// We need a place to store the new blocks generated
85-
let mut new_blocks = Vec::new();
85+
let mut new_blocks = Vec::with_capacity(work.len());
8686

8787
let cur_len = body.basic_blocks.len();
8888
let mut new_block = |source_info: SourceInfo, is_cleanup: bool, target: BasicBlock| {

0 commit comments

Comments
 (0)