Actions
Bug #21124
closedEnumerable#find called without a block returns Enumerator without size
Bug #21124:
Enumerable#find called without a block returns Enumerator without size
Description
When a collection's size is known then enumerator that iterates it usually has size (that's #size returns a collection size).
But an enumerator returned by Enumerable#find called without a block doesn't have size:
[1, 2, 3].find.size # => nil
Expected result here is 3.
Usually similar methods in the Enumerable module return enumerators with size (when these enumerators for instance iterate the collection itself):
[1, 2, 3].each_entry.size # => 3
Actions