diff options
| author | Jack Nagel | 2013-06-27 01:18:32 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-06-27 01:18:45 -0500 |
| commit | bc80b3d190b9aaca5514f28aab94a2cb33937b26 (patch) | |
| tree | b28b5d65aadd80e8bd98ac07ca22252eb89cd6fd /Library/Homebrew/requirements/python_dependency.rb | |
| parent | ecebcb67f62504fa9dd4e174fb3459ca6b2d33d9 (diff) | |
| download | homebrew-bc80b3d190b9aaca5514f28aab94a2cb33937b26.tar.bz2 | |
Fix some #eql? correctness issues
The implementation of #eql? and #hash should ensure that if a.eql?(b),
then a.hash == b.hash, but #eql? itself should not *depend* on #hash.
For example, given
class Thingy
def eql?
instance_of?(other.class) && hash == other.hash
end
def hash
[name, *tags].hash
end
end
if #hash produces a collision for different values of [name, *tags], two
Thingy objects will appear to be eql?, even though this is not the case.
Instead, #eql? should depend on the equality of name and tags directly.
Diffstat (limited to 'Library/Homebrew/requirements/python_dependency.rb')
0 files changed, 0 insertions, 0 deletions
