Merge branch 'master' of github.com:mongodb/mongo-ruby-driver
This commit is contained in:
commit
9e38ef4f8b
|
@ -111,5 +111,23 @@ class OrderedHash < Hash
|
|||
super
|
||||
@ordered_keys = []
|
||||
end
|
||||
|
||||
def hash
|
||||
code = 17
|
||||
each_pair do |key, value|
|
||||
code = 37 * code + key.hash
|
||||
code = 37 * code + value.hash
|
||||
end
|
||||
code
|
||||
end
|
||||
|
||||
def eql?(o)
|
||||
if o.instance_of? OrderedHash
|
||||
self.hash == o.hash
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue