mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(isolated_declarations): do not copy Vec unnecessarily (#7332)
This function receives an owned `oxc_allocator::Vec`. No need to copy the contents to a new `Vec` with `AstBuilder::vec_from_iter`, can just use the original.
This commit is contained in:
parent
44fd962fbb
commit
1938a1d6d9
1 changed files with 1 additions and 6 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue