Commits
Click on a commit to change the comparison rangeperf(semantic): simplify logic in `enter_scope` + `leave_scope` (#4383)
`SemanticBuilder::enter_scope` contained multiple checks purely to handle when called for `Program` scope (where scope has no parent). This is a very uncommon case as `Program` is visited only once, but these checks run for every scope.
So don't call `enter_scope` from `visit_program`, and inline the special logic for root scope there instead, to simplify `enter_scope`.
A branch in `leave_scope` also gets more predictable (always taken).1 year ago
by overlookmotel