Actions
Feature #17838
closed`Set#intersect?` and enumerables
Description
Set#intersect?
currently accepts only a set
argument.
It should accept an enumerable argument:
[1, 2, 3].intersect?(Set[2, 3, 4]) # => true
Set[2, 3, 4].intersection([1, 2, 3]) # => Set[2, 3]
Set[2, 3, 4].intersect?([1, 2, 3]) # => ArgumentError
I expect set.intersect?(arg)
to be an optimized version of !set.intersection(arg).empty?
Should I prepare a PR?
Actions
Like0
Like0Like0