use more specific function to get symbols/regions

This commit is contained in:
Folkert 2022-04-22 21:40:06 +02:00
parent 6ffe14809f
commit 8720462839
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 4 additions and 7 deletions

View file

@ -1274,7 +1274,7 @@ fn canonicalize_pending_value_def<'a>(
); );
can_defs_by_symbol.insert(symbol, def); can_defs_by_symbol.insert(symbol, def);
} else { } else {
for (_, (symbol, _)) in scope.idents() { for (symbol, _) in scope.symbols() {
if !vars_by_symbol.contains_key(symbol) { if !vars_by_symbol.contains_key(symbol) {
continue; continue;
} }
@ -1432,7 +1432,7 @@ fn canonicalize_pending_value_def<'a>(
); );
can_defs_by_symbol.insert(symbol, def); can_defs_by_symbol.insert(symbol, def);
} else { } else {
for (_, (symbol, region)) in scope.idents() { for (symbol, region) in scope.symbols() {
if !vars_by_symbol.contains_key(symbol) { if !vars_by_symbol.contains_key(symbol) {
continue; continue;
} }

View file

@ -88,10 +88,6 @@ impl Scope {
} }
} }
pub fn idents(&self) -> impl Iterator<Item = (&Ident, &(Symbol, Region))> {
self.idents.iter()
}
pub fn symbols(&self) -> impl Iterator<Item = (&Symbol, &Region)> { pub fn symbols(&self) -> impl Iterator<Item = (&Symbol, &Region)> {
self.symbols.iter() self.symbols.iter()
} }
@ -181,7 +177,8 @@ impl Scope {
opt_defined_alias: Option<Region>, opt_defined_alias: Option<Region>,
) -> RuntimeError { ) -> RuntimeError {
let opaques_in_scope = self let opaques_in_scope = self
.idents() .idents
.iter()
.filter(|(_, (sym, _))| { .filter(|(_, (sym, _))| {
self.aliases self.aliases
.get(sym) .get(sym)