diff options
author | Jason Chan <jason.chan@mongodb.com> | 2020-07-15 11:36:05 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-07-15 12:00:27 +0000 |
commit | 113a4c0b7835cb5b69af75f042406ae82820a5ce (patch) | |
tree | 172b49a816236b6613ee8678915c92f68ad9bfcd /src/mongo/bson | |
parent | c6d6f989ef0b320c36bf62e4fd7dd0c4d335da38 (diff) | |
download | mongo-113a4c0b7835cb5b69af75f042406ae82820a5ce.tar.gz |
Revert "SERVER-49351 Implement readKeyStringValueIntoAccessors()"
This reverts commit 0daf2a1c327da1af9c53009cca44a6597373c482.
Diffstat (limited to 'src/mongo/bson')
-rw-r--r-- | src/mongo/bson/ordering.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mongo/bson/ordering.h b/src/mongo/bson/ordering.h index d1178623f91..1521044d468 100644 --- a/src/mongo/bson/ordering.h +++ b/src/mongo/bson/ordering.h @@ -39,12 +39,11 @@ namespace mongo { * Over time we should push this up higher and higher. */ class Ordering { - uint32_t bits; - Ordering(uint32_t b) : bits(b) {} + unsigned bits; + Ordering(unsigned b) : bits(b) {} public: static constexpr size_t kMaxCompoundIndexKeys = size_t{32}; - static_assert(kMaxCompoundIndexKeys == 8 * sizeof(bits)); static Ordering allAscending() { return {0}; @@ -63,24 +62,24 @@ public: uassert(ErrorCodes::Overflow, str::stream() << "Ordering offset is out of bounds: " << i, i >= 0 && static_cast<size_t>(i) < kMaxCompoundIndexKeys); - return ((1u << i) & bits) ? -1 : 1; + return ((1 << i) & bits) ? -1 : 1; } - uint32_t descending(uint32_t mask) const { + unsigned descending(unsigned mask) const { return bits & mask; } static Ordering make(const BSONObj& obj) { - uint32_t b = 0; + unsigned b = 0; BSONObjIterator k(obj); - uint32_t n = 0; + unsigned n = 0; while (1) { BSONElement e = k.next(); if (e.eoo()) break; uassert(13103, "too many compound keys", n < kMaxCompoundIndexKeys); if (e.number() < 0) - b |= (1u << n); + b |= (1 << n); n++; } return Ordering(b); |