Skip to content

Commit 7863097

Browse files
lauraharkercopybara-github
authored andcommitted
Rework how 'twin' Refs are represented in GlobalNamespace
A 'twin' ref is created when a name reference in the AST is both a 'get' and 'set', like 'a.b' in the following expression: `c = a.b = 0;`. Currently GlobalNamespace creates two unique Ref objects in this case, one "get" and one "set". This CL adds a new "get and set" ref type and creates one such Ref, not two. Why? * overall decrease in code size * I think this model is overall easier to understand * helps runtime perf & memory usage by consolidating two fields tracking Refs in GlobalNamespace.Name into one before: refs were tracked both in a `Set<Ref>` and `Map<Node, ImmutableList<Ref>>` after: refs are only tracked in a single `Map<Node, Ref>` PiperOrigin-RevId: 499523572
1 parent 8a649a3 commit 7863097

File tree

3 files changed

+151
-268
lines changed

3 files changed

+151
-268
lines changed

0 commit comments

Comments
 (0)