2c9cfbd1e1
As a copy of Occurrences, this computer would previously build all of the groups for all elements (/loop nodes) in the document and then filter at the end. With this change, we determine the target element(s) or node first, and then only collect the related tokens as we walk the AST. This should reduce the amount of memory used and reduce the cost of doing something like https://github.com/Dart-Code/Dart-Code/issues/4670 which may add some additional computation for resolving members to their super-most element. Change-Id: Id516dbdf26b0b6ac3b1bedc7bc092f1f79f94a95 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/479622 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>