mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Avoid some Arc
cloning
This commit is contained in:
parent
eb17e90eba
commit
b8eb63f2b2
@ -53,7 +53,7 @@ impl Hygiene {
|
|||||||
pub fn local_inner_macros(&self, db: &dyn AstDatabase, path: ast::Path) -> Option<CrateId> {
|
pub fn local_inner_macros(&self, db: &dyn AstDatabase, path: ast::Path) -> Option<CrateId> {
|
||||||
let mut token = path.syntax().first_token()?.text_range();
|
let mut token = path.syntax().first_token()?.text_range();
|
||||||
let frames = self.frames.as_ref()?;
|
let frames = self.frames.as_ref()?;
|
||||||
let mut current = frames.0.clone();
|
let mut current = &frames.0;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let (mapped, origin) = current.expansion.as_ref()?.map_ident_up(db, token)?;
|
let (mapped, origin) = current.expansion.as_ref()?.map_ident_up(db, token)?;
|
||||||
@ -64,7 +64,7 @@ impl Hygiene {
|
|||||||
None
|
None
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
current = current.call_site.as_ref()?.clone();
|
current = current.call_site.as_ref()?;
|
||||||
token = mapped.value;
|
token = mapped.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user