diff --git a/crates/oxc_semantic/src/node.rs b/crates/oxc_semantic/src/node.rs index 92df5a0fd..1ce686d90 100644 --- a/crates/oxc_semantic/src/node.rs +++ b/crates/oxc_semantic/src/node.rs @@ -87,7 +87,7 @@ impl<'a> AstNodes<'a> { #[inline] pub fn is_empty(&self) -> bool { - self.nodes.len() == 0 + self.nodes.is_empty() } /// Walk up the AST, iterating over each parent node. diff --git a/crates/oxc_semantic/src/scope.rs b/crates/oxc_semantic/src/scope.rs index 01d035d57..4592c972a 100644 --- a/crates/oxc_semantic/src/scope.rs +++ b/crates/oxc_semantic/src/scope.rs @@ -41,7 +41,7 @@ impl ScopeTree { #[inline] pub fn is_empty(&self) -> bool { - self.len() == 0 + self.parent_ids.is_empty() } pub fn ancestors(&self, scope_id: ScopeId) -> impl Iterator + '_ {