From 9b43c8c865a73f96cdeb1e3c117f9f806bd5e543 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Sun, 17 Nov 2024 18:52:35 +0000 Subject: [PATCH] refactor(isolated_declarations): do not copy `Vec` unnecessarily --- crates/oxc_isolated_declarations/src/declaration.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/oxc_isolated_declarations/src/declaration.rs b/crates/oxc_isolated_declarations/src/declaration.rs index c5ef8fcb842c84..701e1b5da15a2e 100644 --- a/crates/oxc_isolated_declarations/src/declaration.rs +++ b/crates/oxc_isolated_declarations/src/declaration.rs @@ -41,12 +41,7 @@ impl<'a> IsolatedDeclarations<'a> { decl: &VariableDeclaration<'a>, declarations: oxc_allocator::Vec<'a, VariableDeclarator<'a>>, ) -> Box<'a, VariableDeclaration<'a>> { - self.ast.alloc_variable_declaration( - decl.span, - decl.kind, - self.ast.vec_from_iter(declarations), - self.is_declare(), - ) + self.ast.alloc_variable_declaration(decl.span, decl.kind, declarations, self.is_declare()) } pub(crate) fn transform_variable_declarator(