-
Jack Nagel authored
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.
Jack Nagel authoredThe 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.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.