summaryrefslogtreecommitdiff
path: root/src/mongo/bson/simple_bsonelement_comparator.h
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2016-09-06 18:16:43 -0400
committerDavid Storch <david.storch@10gen.com>2016-09-09 15:05:13 -0400
commit613134ad5960767276df350db1f90cc919225dd5 (patch)
treeb3af405211503717a2524813237734b3af2613a8 /src/mongo/bson/simple_bsonelement_comparator.h
parentf6397011fa6f607a80a6bde1408bf6afddaf20a7 (diff)
downloadmongo-613134ad5960767276df350db1f90cc919225dd5.tar.gz
SERVER-23990 move BSONObj/BSONElement hashing into {BSONObj,BSONElement}::ComparatorInterface
Diffstat (limited to 'src/mongo/bson/simple_bsonelement_comparator.h')
-rw-r--r--src/mongo/bson/simple_bsonelement_comparator.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/bson/simple_bsonelement_comparator.h b/src/mongo/bson/simple_bsonelement_comparator.h
index 001f70d21fe..b05204c3f50 100644
--- a/src/mongo/bson/simple_bsonelement_comparator.h
+++ b/src/mongo/bson/simple_bsonelement_comparator.h
@@ -45,6 +45,11 @@ public:
int compare(const BSONElement& lhs, const BSONElement& rhs) const final {
return lhs.woCompare(rhs, true, nullptr);
}
+
+ void hash_combine(size_t& seed, const BSONElement& toHash) const final {
+ const bool considerFieldName = true;
+ hashCombineBSONElement(seed, toHash, considerFieldName, nullptr);
+ }
};
} // namespace mongo