mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
perf(transformer): remove an allocation from arrow functions transform (#5412)
Follow-up after #5356. No need to allocate a new `IdentifierReference` when we can just mutate the existing one.
This commit is contained in:
parent
be4642fc02
commit
a1523c6cc8
1 changed files with 3 additions and 3 deletions
|
|
@ -158,9 +158,9 @@ impl<'a> Traverse<'a> for ArrowFunctions<'a> {
|
|||
|
||||
if let JSXMemberExpressionObject::IdentifierReference(ident) = node {
|
||||
if ident.name == "this" {
|
||||
let mut new_ident = self.get_this_name(ctx).create_read_reference(ctx);
|
||||
new_ident.span = ident.span;
|
||||
*node = ctx.ast.jsx_member_expression_object_from_identifier_reference(new_ident);
|
||||
let new_ident = self.get_this_name(ctx).create_read_reference(ctx);
|
||||
ident.name = new_ident.name;
|
||||
ident.reference_id = new_ident.reference_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue