Open
Description
The Enumerable#to_set
method can accept a block like Enumerable#map
and it will return a Set
containing unique entries.
If the return value of #map
(a) Doesn't need to include duplicates or (b) Needs to be an Array
because the public interface of the method says it must be an Array
, then we would expect appropriate tests to ensure this property holds.
If neither of these is the case, then a Set
can often function just as well as an Array
, and perhaps even better if the assumption is that there can be no duplicate entries.