From bdee72e27c21eb11721e747a77338bd99eac71fe Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Mon, 19 Aug 2024 12:01:00 +0100 Subject: [PATCH] refactor(ast): `AstBuilder::move_identifier_reference` do not allocate empty string --- crates/oxc_ast/src/ast_builder_impl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_ast/src/ast_builder_impl.rs b/crates/oxc_ast/src/ast_builder_impl.rs index 5f6c2580f26f91..4f4a7f0308a4e3 100644 --- a/crates/oxc_ast/src/ast_builder_impl.rs +++ b/crates/oxc_ast/src/ast_builder_impl.rs @@ -75,7 +75,7 @@ impl<'a> AstBuilder<'a> { self, expr: &mut IdentifierReference<'a>, ) -> IdentifierReference<'a> { - let dummy = self.identifier_reference(expr.span(), ""); + let dummy = self.identifier_reference(expr.span(), Atom::empty()); mem::replace(expr, dummy) }