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

parent c326ab87
......@@ -518,9 +518,12 @@ module Enumerable
#
def reverse_each(&block)
ary = []
self.each {|*val| ary.push(val.__svalue) }
ary.reverse_each(&block)
ary = self.to_a
i = ary.size - 1
while i>=0
block.call(ary[i])
i -= 1
end
self
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