mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Array#reverse_each should return Enumerator; ref #1968
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user