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
|
super
|
||||||
@ordered_keys = []
|
@ordered_keys = []
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user