From 862838fd286da0c88ccfea6e710926a9331fbf3d Mon Sep 17 00:00:00 2001 From: Dunqing <29533304+Dunqing@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:06:55 +0000 Subject: [PATCH] perf(codegen): remove useless to_owned (#8014) --- crates/oxc_codegen/src/gen.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index 2c4c766ce0ec4..bc36e0c1e25ce 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -2040,7 +2040,7 @@ impl Gen for AssignmentTargetProperty<'_> { impl Gen for AssignmentTargetPropertyIdentifier<'_> { fn gen(&self, p: &mut Codegen, ctx: Context) { - let ident_name = p.get_identifier_reference_name(&self.binding).to_owned(); + let ident_name = p.get_identifier_reference_name(&self.binding); if ident_name == self.binding.name.as_str() { self.binding.print(p, ctx); } else { @@ -2048,7 +2048,7 @@ impl Gen for AssignmentTargetPropertyIdentifier<'_> { p.print_str(self.binding.name.as_str()); p.print_colon(); p.print_soft_space(); - p.print_str(&ident_name); + p.print_str(ident_name); } if let Some(expr) = &self.init { p.print_soft_space();