diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-15 06:35:55 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-15 06:35:55 +0000 |
commit | 2edbb9d0f802bab53153979c59125dd0afaafccf (patch) | |
tree | 76c471687bb6af4c8c0528187471346008838622 /lib/set.rb | |
parent | 772396882f02ec3738242a4e83a34e4fc32597bb (diff) |
* 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
Diffstat (limited to 'lib/set.rb')
-rw-r--r-- | lib/set.rb | 14 |
1 files changed, 7 insertions, 7 deletions
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) || [email protected](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) || [email protected](o) # nil # else -# @hash[o] = true +# @hash[o] = o # self # end # end |