Skip to content

Conversation

@z33ky
Copy link
Contributor

@z33ky z33ky commented Jun 29, 2019

Since the old *Collectors are removed, this is an API-breaking change.
They could easily be re-added on top of the Visitors though.

z33ky added 2 commits June 29, 2019 12:18
Instead of allocating a Vec to put the query results in, the Collectors
are changed to call a visitor instead. If the call-site does want a Vec,
they can easily collect themselves.
We ourselves do not actually need this, so we can remove a couple of
Vecs and corresponding allocations for some operations.

The *Collectors are also appropriately renamed to *Visitor.
@z33ky z33ky force-pushed the visiting-visitors branch from 82104c5 to aa8bbc2 Compare April 7, 2020 17:24
@z33ky
Copy link
Contributor Author

z33ky commented Apr 19, 2020

I've missed explaining the motivation for this change.
Well, for one this gets rid of some Vecs, alleviating the need to allocate dynamic memory during iteration. The Vecs got reused, so the time-cost got amortized somewhat. However, this is not necessary anymore.
Additionally, the new interface allows to return early or skip the children of certain nodes via the visitor's return-value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant