ast: reduce memory usage of ast.ScopeObject and ast.Ident instances (#24704)

This commit is contained in:
Delyan Angelov 2025-06-12 17:14:05 +03:00 committed by GitHub
parent 9e2462a876
commit b6ccca23a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 32 additions and 11 deletions

View file

@ -385,8 +385,8 @@ fn (t Tree) objects(so map[string]ast.ScopeObject) &Node {
}
fn (t Tree) scope_object(node ast.ScopeObject) &Node {
mut obj := create_object()
match node {
obj := match node {
ast.EmptyScopeObject { create_object() }
ast.ConstField { t.const_field(node) }
ast.GlobalField { t.global_field(node) }
ast.Var { t.var(node) }