aboutsummaryrefslogtreecommitdiffstats
path: root/lib/set.rb
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-03 06:04:54 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-03 06:04:54 +0000
commit54fbbb48847b4e98c64bcce37eff2349a594baae (patch)
tree11360d8fd955bda6de03a055fe10f49984575b2d /lib/set.rb
parent489bf84b9f95f45e6f1b232403f02939a93d159d (diff)
downloadruby-54fbbb48847b4e98c64bcce37eff2349a594baae.tar.gz
Properly back out.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/set.rb')
-rw-r--r--lib/set.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/set.rb b/lib/set.rb
index 662b698b4e..4cba96e9e2 100644
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -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!