Skip to content

Commit 1744ae8

Browse files
committed
ref: remove redundant vec and duplicate indexing in find_noop_landing_pads
1 parent a0326ca commit 1744ae8

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

‎compiler/rustc_mir_transform/src/remove_noop_landing_pads.rs‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,9 @@ fn find_noop_landing_pads<'tcx>(
172172

173173
// This is a post-order traversal, so that if A post-dominates B
174174
// then A will be visited before B.
175-
let postorder: Vec<_> = traversal::postorder(body).map(|(bb, _)| bb).collect();
176-
for bb in postorder {
177-
let is_nop_landing_pad = RemoveNoopLandingPads.is_nop_landing_pad(
178-
tcx,
179-
&body.basic_blocks[bb],
180-
body,
181-
&nop_landing_pads,
182-
extra,
183-
);
175+
for (bb, bb_data) in traversal::postorder(body) {
176+
let is_nop_landing_pad =
177+
RemoveNoopLandingPads.is_nop_landing_pad(tcx, bb_data, body, &nop_landing_pads, extra);
184178
if is_nop_landing_pad {
185179
nop_landing_pads.insert(bb);
186180
}

0 commit comments

Comments
 (0)