Move a few more candidate rules to the deferred Binding-only pass (#5853)

## Summary

No behavior change, but this is in theory more efficient, since we can
just iterate over the flat `Binding` vector rather than having to
iterate over binding chains via the `Scope`.
This commit is contained in:
Charlie Marsh 2023-07-18 20:59:02 -04:00 committed by GitHub
parent 626d8dc2cc
commit 1181d25e5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 86 additions and 81 deletions

View file

@ -189,6 +189,7 @@ impl<'a> SemanticModel<'a> {
self.bindings.push(Binding {
range: TextRange::default(),
kind: BindingKind::Builtin,
scope: ScopeId::global(),
references: Vec::new(),
flags: BindingFlags::empty(),
source: None,
@ -209,6 +210,7 @@ impl<'a> SemanticModel<'a> {
kind,
flags,
references: Vec::new(),
scope: self.scope_id,
source: self.stmt_id,
context: self.execution_context(),
exceptions: self.exceptions(),
@ -795,6 +797,7 @@ impl<'a> SemanticModel<'a> {
kind: BindingKind::Assignment,
range: *range,
references: Vec::new(),
scope: self.scope_id,
source: self.stmt_id,
context: self.execution_context(),
exceptions: self.exceptions(),