Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Truffle] Pulled Array#reverse_each from Rubinius.
  • Loading branch information
nirvdrum committed Feb 19, 2015
1 parent 0d40fe1 commit c3a7c5a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
5 changes: 0 additions & 5 deletions spec/truffle/tags/core/array/reverse_each_tags.txt

This file was deleted.

15 changes: 15 additions & 0 deletions truffle/src/main/ruby/core/rubinius/common/array.rb
Expand Up @@ -373,6 +373,21 @@ def flatten!(level=-1)
nil
end

def reverse_each
return to_enum(:reverse_each) unless block_given?

stop = @start - 1
i = stop + @total
tuple = @tuple

while i > stop
yield tuple.at(i)
i -= 1
end

self
end

def to_a
if self.instance_of? Array
self
Expand Down

0 comments on commit c3a7c5a

Please sign in to comment.