Move a call outside a loop.

This path isn't hot enough for this to affect performance, but there's
no point repeating the same computation multiple times.
This commit is contained in:
Nicholas Nethercote 2024-11-08 15:24:13 +11:00
parent d71c06d022
commit 6e0e9edbe0

View File

@ -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;