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 Set#intersect? and #disjoint? to accept array argument #18

Merged
merged 3 commits into from
Jun 18, 2021

Conversation

jeremyevans
Copy link
Contributor

Implements [Feature #17838]

@marcandre
Copy link
Member

Why not go further and allow any Enumerable?

In that case, we simply loop on it and check against the set. For many cases, that would be more efficient than building an intermediary set as proposed here.

@jeremyevans
Copy link
Contributor Author

Considering I screwed up the implementation and create an intermediate set without doing anything with it, that seems fine with me.

Copy link
Member

@marcandre marcandre left a comment

Choose a reason for hiding this comment

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

👍 LGTM

Copy link
Member

@knu knu left a comment

Choose a reason for hiding this comment

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

Looks good. Please update the document and add an array example also!

@jeremyevans
Copy link
Contributor Author

@knu Thank you for your review. I've pushed a commit that updates the documentation.

Copy link
Member

@knu knu left a comment

Choose a reason for hiding this comment

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

Thank you!

@knu knu merged commit f6fc6f3 into ruby:master Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants