Array#reverse_each should return Enumerator; ref #1968

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-03-28 23:18:55 +09:00
parent 5625104291
commit 97f22c9516
+2
View File
@@ -204,6 +204,8 @@ class Array
# for efficiency
def reverse_each(&block)
return to_enum :sort_by unless block_given?
i = self.size - 1
while i>=0
block.call(self[i])