Skip to content

Commit

Permalink
Merge pull request #4153 from Mark-Simulacrum/reduce-symbol-lookups
Browse files Browse the repository at this point in the history
Pre-intern name when searching module children
  • Loading branch information
RalfJung authored Jan 26, 2025
2 parents 841a1a2 + b3a37bb commit 34f3bfa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ fn try_resolve_did(tcx: TyCtxt<'_>, path: &[&str], namespace: Option<Namespace>)
item: DefId,
name: &'a str,
) -> impl Iterator<Item = DefId> + 'a {
let name = Symbol::intern(name);
tcx.module_children(item)
.iter()
.filter(move |item| item.ident.name.as_str() == name)
.filter(move |item| item.ident.name == name)
.map(move |item| item.res.def_id())
}

Expand Down

0 comments on commit 34f3bfa

Please sign in to comment.