mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
- ==(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: svn+ssh://ci.ruby-lang.org/ruby/trunk@2788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
64901cd69b
commit
ec43854aa6
1 changed files with 2 additions and 2 deletions
|
@ -335,7 +335,7 @@ class Set
|
||||||
def ==(set)
|
def ==(set)
|
||||||
equal?(set) and return true
|
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 }
|
set.each { |o| include?(o) or return false }
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ class Set
|
||||||
end
|
end
|
||||||
|
|
||||||
def eql?(o)
|
def eql?(o)
|
||||||
@hash == o.hash
|
@hash.hash == o.hash
|
||||||
end
|
end
|
||||||
|
|
||||||
def classify
|
def classify
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue