Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor consumer Node and iterators to reduce lookups #40

Merged
merged 1 commit into from
Oct 3, 2021

Conversation

mwcampbell
Copy link
Contributor

The key insight that made this possible was the realization that Node could derive the Copy trait, which meant that Node methods that return other Nodes don't need to borrow self.

Fixes #4

@mwcampbell
Copy link
Contributor Author

@DataTriny What do you think of this?

@DataTriny
Copy link
Member

I feel kinda stupid right now: I knew that deriving Copy would help with these iterators but for some reason I thought this would not be possible due to the fact that NodeData contains Strings, but since we only store a reference to a NodeState then indeed it works! Nice catch!

The code looks good to me, you can proceed to merge.

@mwcampbell mwcampbell merged commit 23adc9b into main Oct 3, 2021
@mwcampbell mwcampbell deleted the node-and-iterator-refactor branch October 3, 2021 20:33
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.

Need methods for traversing nodes, including unignored nodes
2 participants