-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass 'parents' as a parameter when walking the tree
Rather than storing the 'parents' deque as an instance attribute, pass it as a parameter as we walk the tree. This gives us more explicit control of this stack's lifetime (and no more mutable state on the object itself), and it allows us to better restrict the typed interface we present to visitor methods (`Iterable`). It also might result in a micro-optimization because read a parameter value is less involved (faster) than loading an instance attribute, but that isn't the goal of this change.
- Loading branch information
Showing
1 changed file
with
22 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters