summaryrefslogtreecommitdiff
path: root/src/mongo/bson/bsonobj.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2016-08-26 16:23:22 -0400
committerDavid Storch <david.storch@10gen.com>2016-09-02 10:24:02 -0400
commit231de89b7c8e84b7b6cf638008b483ecab6ba1b6 (patch)
tree2b0143e02e4aa93ffee23c2a412264309f383d1e /src/mongo/bson/bsonobj.cpp
parent54488beeea99b3046931109c170d7e51cea0964d (diff)
downloadmongo-231de89b7c8e84b7b6cf638008b483ecab6ba1b6.tar.gz
SERVER-24508 BSONElement::ComparatorInterface
Diffstat (limited to 'src/mongo/bson/bsonobj.cpp')
-rw-r--r--src/mongo/bson/bsonobj.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/bson/bsonobj.cpp b/src/mongo/bson/bsonobj.cpp
index ca2e0991403..06d8a28c950 100644
--- a/src/mongo/bson/bsonobj.cpp
+++ b/src/mongo/bson/bsonobj.cpp
@@ -192,14 +192,15 @@ size_t BSONObj::Hasher::operator()(const BSONObj& obj) const {
return hash;
}
-bool BSONObj::isPrefixOf(const BSONObj& otherObj) const {
+bool BSONObj::isPrefixOf(const BSONObj& otherObj,
+ const BSONElement::ComparatorInterface& eltCmp) const {
BSONObjIterator a(*this);
BSONObjIterator b(otherObj);
while (a.more() && b.more()) {
BSONElement x = a.next();
BSONElement y = b.next();
- if (x != y)
+ if (eltCmp.evaluate(x != y))
return false;
}