mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
refactor(ast): make AstBuilder Copy (#3602)
`AstBuilder` only contains a shared ref `&Allocator`. So make it `Copy` and pass around `AstBuilder<'a>` instead of `&AstBuilder<'a>` - 1 less level of indirection. Hopefully this will have little effect on benchmarks as all `AstBuilder`'s methods are marked `#[inline]`, but this change will minimize impact if compiler decides not to inline for some reason.
This commit is contained in:
parent
d6370f19fe
commit
08f1010dca
3 changed files with 218 additions and 236 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -412,8 +412,8 @@ impl<'a> ReactJsx<'a> {
|
|||
self.ctx.source_type.is_script()
|
||||
}
|
||||
|
||||
fn ast(&self) -> &AstBuilder<'a> {
|
||||
&self.ctx.ast
|
||||
fn ast(&self) -> AstBuilder<'a> {
|
||||
self.ctx.ast
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ impl<'a> TypeScriptAnnotations<'a> {
|
|||
|
||||
// Creates `this.name = name`
|
||||
fn create_this_property_assignment(&self, name: &Atom<'a>) -> Statement<'a> {
|
||||
let ast = &self.ctx.ast;
|
||||
let ast = self.ctx.ast;
|
||||
|
||||
ast.expression_statement(
|
||||
SPAN,
|
||||
|
|
|
|||
Loading…
Reference in a new issue