From 54fbbb48847b4e98c64bcce37eff2349a594baae Mon Sep 17 00:00:00 2001 From: knu Date: Tue, 3 Jun 2008 06:04:54 +0000 Subject: [PATCH] Properly back out. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/set.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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!