summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-04 07:15:17 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-04 07:15:17 +0000
commit8f757a89faca700618194684d3beaad34ba91e27 (patch)
treee75ecf31c5f5452119c5efb70a560c3b51934efe
parentc82416c14d78df9516778c2a3df815a7e62106dd (diff)
downloadruby-8f757a89faca700618194684d3beaad34ba91e27.tar.gz
ruby-8f757a89faca700618194684d3beaad34ba91e27.tar.xz
ruby-8f757a89faca700618194684d3beaad34ba91e27.zip
- ==(o) should be aware of all the Set variant instances, not just
those of its subclasses. - Fix eql?(). Submitted by: "Christoph" <chr_news@gmx.net> git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/set.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/set.rb b/lib/set.rb
index 1df42e08d..1dcfbfcde 100644
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -335,7 +335,7 @@ class Set
def ==(set)
equal?(set) and return true
- set.is_a?(type) && size == set.size or return false
+ set.is_a?(Set) && size == set.size or return false
set.each { |o| include?(o) or return false }
@@ -347,7 +347,7 @@ class Set
end
def eql?(o)
- @hash == o.hash
+ @hash.hash == o.hash
end
def classify