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

Implement iterator over nodes; refactor key-value iterator #517

Merged
merged 90 commits into from
Feb 13, 2024

Conversation

danlaine
Copy link

@danlaine danlaine commented Feb 6, 2024

alternate implementation to #499.

This PR implements an iterator over nodes. The iterator can be configured to start at a given key. Uses this node iterator to refactor the key-value iterator implementation.

Copy link
Collaborator

@rkuris rkuris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, all are remaining nits. There is one extra allocation you should probably remove before merging.

== Ordering::Greater
{
// `child` is after `key`.
let key = matched_key_nibbles
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: since we're doing exactly the same thing earlier, perhaps a helper function would be useful here

}
check_stream_is_done(stream).await;

// Test with start key
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: new test?

@danlaine danlaine enabled auto-merge (squash) February 12, 2024 23:37
@danlaine danlaine merged commit 94155c2 into main Feb 13, 2024
5 of 6 checks passed
@danlaine danlaine deleted the node-iterator branch February 13, 2024 13:52
@richardpringle
Copy link
Contributor

🥇

@danlaine danlaine linked an issue Feb 21, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

fix firewood stream implementation
3 participants