Skip to content

Commit

Permalink
implement this more efficiently
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Gaynor committed Mar 24, 2013
1 parent a270d98 commit 840b618
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib-topaz/array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,11 @@ def reverse
end

def reverse_each(&block)
reverse.each(&block)
self
i = self.length - 1
while i >= 0
yield self[i]
i -= 1
end
return self
end
end

0 comments on commit 840b618

Please sign in to comment.