From 9e85cc10c9d82d5597ae354ed13cd276c5d9b1e3 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:50:04 +0000 Subject: [PATCH] refactor(semantic): remove duplicated code (#7276) `if matches!(self.kind, TSModuleDeclarationKind::Global)` at top of function already performed this check, no need to check it again. --- crates/oxc_semantic/src/binder.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/oxc_semantic/src/binder.rs b/crates/oxc_semantic/src/binder.rs index e8031622976ae..693f8fe0fc82c 100644 --- a/crates/oxc_semantic/src/binder.rs +++ b/crates/oxc_semantic/src/binder.rs @@ -409,11 +409,8 @@ impl<'a> Binder<'a> for TSModuleDeclaration<'a> { SymbolFlags::None, ); - // do not bind `global` for `declare global { ... }` - if !self.kind.is_global() { - if let TSModuleDeclarationName::Identifier(id) = &self.id { - id.symbol_id.set(Some(symbol_id)); - } + if let TSModuleDeclarationName::Identifier(id) = &self.id { + id.symbol_id.set(Some(symbol_id)); } } }