mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(ast): AstBuilder::move_identifier_reference do not allocate empty string (#4977)
#4920 introduced `AstBuilder::move_identifier_reference`. Make this slightly cheaper by using a static empty `Atom` rather than relying on `"".into_in(allocator)` which allocates an empty string into arena.
This commit is contained in:
parent
64ace42566
commit
4012260c17
1 changed files with 1 additions and 1 deletions
|
|
@ -75,7 +75,7 @@ impl<'a> AstBuilder<'a> {
|
||||||
self,
|
self,
|
||||||
expr: &mut IdentifierReference<'a>,
|
expr: &mut IdentifierReference<'a>,
|
||||||
) -> IdentifierReference<'a> {
|
) -> IdentifierReference<'a> {
|
||||||
let dummy = self.identifier_reference(expr.span(), "");
|
let dummy = self.identifier_reference(expr.span(), Atom::empty());
|
||||||
mem::replace(expr, dummy)
|
mem::replace(expr, dummy)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue