From 2edbb9d0f802bab53153979c59125dd0afaafccf Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 15 Dec 2004 06:35:55 +0000 Subject: * lib/set.rb (Set#==): [ruby-dev:25206] * ext/openssl/ossl_digest.c (ossl_digest_initialize): [ruby-dev:25198] * utf8.c (utf8_is_mbc_ambiguous): [ruby-talk:123561] * utf8.c (utf8_mbc_to_normalize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/set.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/set.rb') diff --git a/lib/set.rb b/lib/set.rb index 23d7b847ef..8364d4a072 100644 --- a/lib/set.rb +++ b/lib/set.rb @@ -193,7 +193,7 @@ class Set # Adds the given object to the set and returns self. Use +merge+ to # add several elements at once. def add(o) - @hash[o] = true + @hash[o] = o self end alias << add @@ -313,7 +313,7 @@ class Set set.is_a?(Set) && size == set.size or return false - set.all? { |o| include?(o) } + set.all? { |o| @hash.value?(o) } end def hash # :nodoc: @@ -466,7 +466,7 @@ class SortedSet < Set def add(o) @keys = nil - @hash[o] = true + @hash[o] = o self end alias << add @@ -551,7 +551,7 @@ end # if @proc.arity == 2 # instance_eval %{ # def add(o) -# @hash[o] = true if @proc.call(self, o) +# @hash[o] = o if @proc.call(self, o) # self # end # alias << add @@ -560,7 +560,7 @@ end # if include?(o) || !@proc.call(self, o) # nil # else -# @hash[o] = true +# @hash[o] = o # self # end # end @@ -583,7 +583,7 @@ end # else # instance_eval %{ # def add(o) -# @hash[o] = true if @proc.call(o) +# @hash[o] = o if @proc.call(o) # self # end # alias << add @@ -592,7 +592,7 @@ end # if include?(o) || !@proc.call(o) # nil # else -# @hash[o] = true +# @hash[o] = o # self # end # end -- cgit v1.2.3