Skip to content

Commit

Permalink
refactor(semantic)!: remove SymbolTable::get_symbol_id_from_name an…
Browse files Browse the repository at this point in the history
…d `SymbolTable::get_scope_id_from_name` (#5480)

Close #5456.
  • Loading branch information
overlookmotel committed Sep 5, 2024
1 parent 7414190 commit bd820f9
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions crates/oxc_semantic/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@ impl SymbolTable {
.find_map(|(symbol, &inner_span)| if inner_span == span { Some(symbol) } else { None })
}

pub fn get_symbol_id_from_name(&self, name: &str) -> Option<SymbolId> {
self.names.iter_enumerated().find_map(|(symbol, inner_name)| {
if inner_name.as_str() == name {
Some(symbol)
} else {
None
}
})
}

#[inline]
pub fn get_span(&self, symbol_id: SymbolId) -> Span {
self.spans[symbol_id]
Expand Down Expand Up @@ -135,10 +125,6 @@ impl SymbolTable {
self.get_symbol_id_from_span(span).map(|symbol_id| self.get_scope_id(symbol_id))
}

pub fn get_scope_id_from_name(&self, name: &str) -> Option<ScopeId> {
self.get_symbol_id_from_name(name).map(|symbol_id| self.get_scope_id(symbol_id))
}

#[inline]
pub fn get_declaration(&self, symbol_id: SymbolId) -> AstNodeId {
self.declarations[symbol_id]
Expand Down

0 comments on commit bd820f9

Please sign in to comment.