1
0
Fork 0
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:
knu 2008-06-03 06:04:54 +00:00
parent 489bf84b9f
commit 54fbbb4884

View file

@ -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!