summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/index_entry_comparison.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2014-09-16 17:16:32 -0400
committerEliot Horowitz <eliot@10gen.com>2014-09-17 10:49:29 -0400
commitbd0eed0a669ec9f77cb207d698c6bed002acdd0e (patch)
treeab8ccd978d36c1591501ec8215f2d03e5e639d48 /src/mongo/db/storage/index_entry_comparison.cpp
parentbb0a34d80b4b1e555fab5dda4ddac8ae48e99152 (diff)
downloadmongo-bd0eed0a669ec9f77cb207d698c6bed002acdd0e.tar.gz
SERVER-13635: hook up mmap_v1 to SortedDataInterface test harness and fix mmap_v1
Diffstat (limited to 'src/mongo/db/storage/index_entry_comparison.cpp')
-rw-r--r--src/mongo/db/storage/index_entry_comparison.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/storage/index_entry_comparison.cpp b/src/mongo/db/storage/index_entry_comparison.cpp
index 2e34a5bc64b..1d21a6af9b5 100644
--- a/src/mongo/db/storage/index_entry_comparison.cpp
+++ b/src/mongo/db/storage/index_entry_comparison.cpp
@@ -57,7 +57,8 @@ namespace mongo {
// Iterate through both BSONObjects, comparing individual elements one by one
for (unsigned mask = 1; lhsIt.more(); mask <<= 1) {
- invariant(rhsIt.more());
+ if (!rhsIt.more())
+ return _order.descending(mask) ? -1 : 1;
const BSONElement l = lhsIt.next();
const BSONElement r = rhsIt.next();
@@ -90,7 +91,8 @@ namespace mongo {
}
- invariant(!rhsIt.more());
+ if(rhsIt.more())
+ return -1;
// This means just look at the key, not the loc.
if (lhs.loc.isNull() || rhs.loc.isNull())