Skip to content

Commit

Permalink
Move a call outside a loop.
Browse files Browse the repository at this point in the history
This path isn't hot enough for this to affect performance, but there's
no point repeating the same computation multiple times.
  • Loading branch information
nnethercote committed Nov 14, 2024
1 parent d71c06d commit 6e0e9ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1688,9 +1688,9 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
}
}

let normalized_ident = ident.normalize_to_macros_2_0();
let mut outer_res = None;
for rib in lifetime_rib_iter {
let normalized_ident = ident.normalize_to_macros_2_0();
if let Some((&outer, _)) = rib.bindings.get_key_value(&normalized_ident) {
outer_res = Some(outer);
break;
Expand Down

0 comments on commit 6e0e9ed

Please sign in to comment.