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

fix inconsistent EnumerateChildrenAsync behavior #41

Merged
merged 2 commits into from
Jul 11, 2019

Conversation

Stebalien
Copy link
Member

This fixes the inconsistent EnumerateChildrenAsync behavior by renaming everything.

  1. EnumerateChildrenAsync has been renamed to WalkParallel because it visited root in addition to the children and isn't async (it's parallel).
  2. EnumerateChildren has been renamed to Walk and now also visits the root for consistency.

Anyone needing to skip the root can do so manually (if c.Equals(root) ...).

This is an intentionally breaking change to force an audit of all callsites.

Q: Should we leave an (additional) EnumerateChildren function? That function does exactly what it says already.

This fixes the inconsistent EnumerateChildrenAsync behavior by renaming
everything.

1. EnumerateChildrenAsync has been renamed to WalkParallel because (a) it
visited the root so EnumerateChildren was incorrect and (b) it isn't async.
2. EnumerateChildren has been renamed to Walk and now _also_ visits the root for
consistency.

Anyone needing to skip the root can do so manually (`if c.Equals(root)` ...).
@Stebalien Stebalien requested a review from hsanjuan July 11, 2019 21:54
@Stebalien Stebalien merged commit 625228c into master Jul 11, 2019
@Stebalien Stebalien deleted the fix/walk-behavior branch July 11, 2019 22:16
@Stebalien
Copy link
Member Author

Take heed @ipfs/wg-go-core.

Jorropo pushed a commit to ipfs/boxo that referenced this pull request Mar 15, 2023
fix inconsistent EnumerateChildrenAsync behavior

This commit was moved from ipfs/go-merkledag@625228c
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