Skip to content

Commit

Permalink
[Truffle] Adding Array#select! to array.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish committed Mar 23, 2015
1 parent 3ea7fcd commit b696c67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 0 additions & 6 deletions spec/truffle/tags/core/array/select_tags.txt

This file was deleted.

9 changes: 9 additions & 0 deletions truffle/src/main/ruby/core/rubinius/common/array.rb
Expand Up @@ -926,6 +926,15 @@ def sample(count=undefined, options=undefined)
return count == size ? result : result[0, count]
end

def select!(&block)
return to_enum :select! unless block_given?

Rubinius.check_frozen

ary = select(&block)
replace ary unless size == ary.size
end

def find_index(obj=undefined)
super
end
Expand Down

0 comments on commit b696c67

Please sign in to comment.