Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 66768808cefb
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bd795b2a70fa
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Mar 10, 2015

  1. Copy the full SHA
    807bce5 View commit details
  2. Merge pull request #2679 from bjfish/truffle_array_raassoc

    [Truffle] Adding Array#rassoc to array.rb
    chrisseaton committed Mar 10, 2015
    Copy the full SHA
    bd795b2 View commit details
Showing with 10 additions and 4 deletions.
  1. +0 −4 spec/truffle/tags/core/array/rassoc_tags.txt
  2. +10 −0 truffle/src/main/ruby/core/rubinius/common/array.rb
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/array/rassoc_tags.txt

This file was deleted.

10 changes: 10 additions & 0 deletions truffle/src/main/ruby/core/rubinius/common/array.rb
Original file line number Diff line number Diff line change
@@ -470,6 +470,16 @@ def keep_if(&block)
replace select(&block)
end

def rassoc(obj)
each do |elem|
if elem.kind_of? Array and elem.at(1) == obj
return elem
end
end

nil
end

def reverse_each
return to_enum(:reverse_each) unless block_given?