Skip to content

Commit

Permalink
s/merged_block_count/statements_to_merge/g
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Westerlind committed Mar 2, 2020
1 parent 84c024d commit 851e9d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc_mir/transform/simplify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ impl<'a, 'tcx> CfgSimplifier<'a, 'tcx> {
changed |= inner_changed;
}

let merged_block_count =
let statements_to_merge =
merged_blocks.iter().map(|&i| self.basic_blocks[i].statements.len()).sum();

if merged_block_count > 0 {
if statements_to_merge > 0 {
let mut statements = std::mem::take(&mut self.basic_blocks[bb].statements);
statements.reserve(merged_block_count);
statements.reserve(statements_to_merge);
for &from in &merged_blocks {
statements.append(&mut self.basic_blocks[from].statements);
}
Expand Down

0 comments on commit 851e9d6

Please sign in to comment.