Skip to content

Commit

Permalink
refactor(semantic): use is_empty() instead of len() == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Jul 29, 2024
1 parent c73e179 commit a4118ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/oxc_semantic/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_semantic/src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = ScopeId> + '_ {
Expand Down

0 comments on commit a4118ce

Please sign in to comment.