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

Allow traverse to return enumerator. #117

Closed
ioquatix opened this issue Jun 14, 2021 · 1 comment
Closed

Allow traverse to return enumerator. #117

ioquatix opened this issue Jun 14, 2021 · 1 comment

Comments

@ioquatix
Copy link
Member

Do you mind explaining the expected use case? Because we have traverse which is very close to the implementation.

If I recall, I was using #traverse to return a collection of nodes, like .traverse.map { |node, value| would but got a LocalJumpError. In retrospect, I think I should have proposed an return enum_for(__method__) { size } unless block_given? form for #traverse rather than a new method.

Originally posted by @havenwood in #55 (comment)

@ioquatix
Copy link
Member Author

@havenwood I investigate this, and found that the performance cost shouldn't be too much, so I implemented it.

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

No branches or pull requests

1 participant