mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Properly back out.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
489bf84b9f
commit
54fbbb4884
1 changed files with 3 additions and 1 deletions
|
@ -258,7 +258,9 @@ class Set
|
|||
# Replaces the elements with ones returned by collect().
|
||||
def collect!
|
||||
block_given? or return enum_for(__method__)
|
||||
replace(collect)
|
||||
set = self.class.new
|
||||
each { |o| set << yield(o) }
|
||||
replace(set)
|
||||
end
|
||||
alias map! collect!
|
||||
|
||||
|
|
Loading…
Reference in a new issue