From c0714945b2971f5474ed490ee8e8e3caf401c0c8 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Sat, 14 Dec 2024 04:28:50 +0000 Subject: [PATCH] refactor(semantic)!: remove `SymbolTable::rename` method (#7868) Remove `SymbolTable::rename` method. We also have `SymbolTable::set_name` method which does the same thing. --- crates/oxc_semantic/src/symbol.rs | 5 ----- .../oxc_transformer/src/common/arrow_function_converter.rs | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/oxc_semantic/src/symbol.rs b/crates/oxc_semantic/src/symbol.rs index 2ef0a176be4fc..42fda763edf2a 100644 --- a/crates/oxc_semantic/src/symbol.rs +++ b/crates/oxc_semantic/src/symbol.rs @@ -101,11 +101,6 @@ impl SymbolTable { } /// Rename a symbol. - #[inline] - pub fn rename(&mut self, symbol_id: SymbolId, new_name: CompactStr) { - self.names[symbol_id] = new_name; - } - #[inline] pub fn set_name(&mut self, symbol_id: SymbolId, name: CompactStr) { self.names[symbol_id] = name; diff --git a/crates/oxc_transformer/src/common/arrow_function_converter.rs b/crates/oxc_transformer/src/common/arrow_function_converter.rs index 75d30d3ac47d6..2d528719ba960 100644 --- a/crates/oxc_transformer/src/common/arrow_function_converter.rs +++ b/crates/oxc_transformer/src/common/arrow_function_converter.rs @@ -905,7 +905,7 @@ impl<'a> ArrowFunctionConverter<'a> { /// Rename the `arguments` symbol to a new name. fn rename_arguments_symbol(symbol_id: SymbolId, name: CompactStr, ctx: &mut TraverseCtx<'a>) { let scope_id = ctx.symbols().get_scope_id(symbol_id); - ctx.symbols_mut().rename(symbol_id, name.clone()); + ctx.symbols_mut().set_name(symbol_id, name.clone()); ctx.scopes_mut().rename_binding(scope_id, "arguments", name); }