Actions
Bug #14082
closedEnumerator#size from Enumerable#cycle returns 0 when the object is empty
Description
github: https://github.com/ruby/ruby/pull/1742
Is this an intentional behavior?
p([].cycle.size) #=> 0
p({}.cycle.size) #=> Infinity
Array#cycle already special handled empty arrays. So similar behavior in Enumerable#cycle with the #size sounds reasonable to me.
Actions
Like0
Like0Like0Like0Like0Like0