diff options
Diffstat (limited to 'src/mongo/db/bson/dotted_path_support.cpp')
-rw-r--r-- | src/mongo/db/bson/dotted_path_support.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/bson/dotted_path_support.cpp b/src/mongo/db/bson/dotted_path_support.cpp index 4860e5dfd66..0595c8baf0f 100644 --- a/src/mongo/db/bson/dotted_path_support.cpp +++ b/src/mongo/db/bson/dotted_path_support.cpp @@ -52,13 +52,14 @@ void _extractAllElementsAlongPath(const BSONObj& obj, StringData path, BSONElementColl& elements, bool expandArrayOnTrailingField, - size_t depth, + BSONDepthIndex depth, MultikeyComponents* arrayComponents) { BSONElement e = obj.getField(path); if (e.eoo()) { size_t idx = path.find('.'); if (idx != std::string::npos) { + invariant(depth != std::numeric_limits<BSONDepthIndex>::max()); StringData left = path.substr(0, idx); StringData next = path.substr(idx + 1, path.size()); @@ -166,7 +167,7 @@ void extractAllElementsAlongPath(const BSONObj& obj, BSONElementSet& elements, bool expandArrayOnTrailingField, MultikeyComponents* arrayComponents) { - const size_t initialDepth = 0; + const BSONDepthIndex initialDepth = 0; _extractAllElementsAlongPath( obj, path, elements, expandArrayOnTrailingField, initialDepth, arrayComponents); } @@ -176,7 +177,7 @@ void extractAllElementsAlongPath(const BSONObj& obj, BSONElementMultiSet& elements, bool expandArrayOnTrailingField, MultikeyComponents* arrayComponents) { - const size_t initialDepth = 0; + const BSONDepthIndex initialDepth = 0; _extractAllElementsAlongPath( obj, path, elements, expandArrayOnTrailingField, initialDepth, arrayComponents); } |