ruby / set

This library provides the Set class, which deals with a collection of unordered values with no duplicates.
BSD 2-Clause "Simplified" License
23 stars 13 forks source link

Allow Set#intersect? and #disjoint? to accept array argument #18

Closed jeremyevans closed 3 years ago

jeremyevans commented 3 years ago

Implements [Feature #17838]

marcandre commented 3 years ago

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 commented 3 years ago

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

jeremyevans commented 3 years ago

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