refactor(ast): reduce allocations in AST builder (#3834)

No need to unbox and then box again.
This commit is contained in:
overlookmotel 2024-06-23 03:46:54 +01:00 committed by GitHub
parent ff1da27278
commit 120696741c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -280,7 +280,7 @@ impl<'a> AstBuilder<'a> {
#[inline]
pub fn block_statement(self, block: Box<'a, BlockStatement<'a>>) -> Statement<'a> {
Statement::BlockStatement(self.block(block.span, block.unbox().body))
Statement::BlockStatement(block)
}
#[inline]