diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-11-08 15:24:13 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-11-14 11:35:27 +1100 |
| commit | 6e0e9edbe034b8ce764f91abb5c12b7871e09e9c (patch) | |
| tree | fcb403401fc3fd6978fd5e4646e7a1c6f5a25c0b | |
| parent | d71c06d022b07518f97072ad36cbe2c8a25eee2d (diff) | |
| download | rust-6e0e9edbe034b8ce764f91abb5c12b7871e09e9c.tar.gz rust-6e0e9edbe034b8ce764f91abb5c12b7871e09e9c.zip | |
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.
| -rw-r--r-- | compiler/rustc_resolve/src/late.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index f4a85c358e3..26b345f5941 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -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; |
