From d22a9b72e083f21ea8a56fc7efa0239a29ce57e6 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Mon, 9 Sep 2024 01:07:34 +0000 Subject: [PATCH] refactor(semantic): `SymbolTable::is_empty` use `is_empty` (#5622) Nit. `is_empty()` is sometimes more performant than `len() == 0`. --- crates/oxc_semantic/src/symbol.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_semantic/src/symbol.rs b/crates/oxc_semantic/src/symbol.rs index dcf9b30a441f3..59a6d55197a4e 100644 --- a/crates/oxc_semantic/src/symbol.rs +++ b/crates/oxc_semantic/src/symbol.rs @@ -54,7 +54,7 @@ impl SymbolTable { #[inline] pub fn is_empty(&self) -> bool { - self.len() == 0 + self.spans.is_empty() } pub fn symbol_ids(&self) -> impl Iterator + '_ {