Skip to content

Commit

Permalink
perf(semantic): remove uneccessary allocation in builder
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac committed Jun 24, 2024
1 parent 8c9fc63 commit 93d43be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oxc_semantic/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ impl<'a> SemanticBuilder<'a> {
fn reference_identifier(&mut self, ident: &IdentifierReference) {
let flag = self.resolve_reference_usages();
let name = ident.name.to_compact_str();
let reference = Reference::new(ident.span, name.clone(), self.current_node_id, flag);
let reference = Reference::new(ident.span, name, self.current_node_id, flag);
// `function foo({bar: identifier_reference}) {}`
// ^^^^^^^^^^^^^^^^^^^^ Parameter initializer must be resolved immediately
// to avoid binding to variables inside the scope
Expand Down

0 comments on commit 93d43be

Please sign in to comment.