Enumerable#reverse_each should not rely on mruby-array-ext gem

parent c326ab87
...@@ -518,9 +518,12 @@ module Enumerable ...@@ -518,9 +518,12 @@ module Enumerable
# #
def reverse_each(&block) def reverse_each(&block)
ary = [] ary = self.to_a
self.each {|*val| ary.push(val.__svalue) } i = ary.size - 1
ary.reverse_each(&block) while i>=0
block.call(ary[i])
i -= 1
end
self self
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment