Skip to content

Commit

Permalink
refactor(semantic): SymbolTable::is_empty use is_empty (#5622)
Browse files Browse the repository at this point in the history
Nit. `is_empty()` is sometimes more performant than `len() == 0`.
  • Loading branch information
overlookmotel committed Sep 9, 2024
1 parent 1fa3e56 commit d22a9b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oxc_semantic/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = SymbolId> + '_ {
Expand Down

0 comments on commit d22a9b7

Please sign in to comment.