Commits
Click on a commit to change the comparison rangerefactor(semantic): remove `AstNodes` `program` field (#12516)
`Program` is always the first node in `AstNodes`, so no need to store a duplicate `&Program` reference in `AstNodes`.
I *think* this is an improvement. It does make `AstNodes::program` marginally more expensive, because it now has 2 checks:
1. Check `AstNodes::nodes` is not empty. and
2. Check that first AST node is `Program`.
But both checks are branches which are never taken, so pretty cheap, and both checks share a single panic. So overall, I think it's probably better than `AstNodes` being larger than it otherwise needs to be.4 months ago
by overlookmotel