summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/key_string.h
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2019-09-06 16:28:22 +0000
committerevergreen <evergreen@mongodb.com>2019-09-06 16:28:22 +0000
commit364822297442f0725b879458c4977a04031ff6b1 (patch)
tree37487af0b65f15f327490d516a95f42fba1bb12d /src/mongo/db/storage/key_string.h
parenta74a733800b410f89953e807a86231c522ba66c0 (diff)
downloadmongo-364822297442f0725b879458c4977a04031ff6b1.tar.gz
SERVER-42972 Callers of SortedDataInterface::seekExact should pass KeyString
Diffstat (limited to 'src/mongo/db/storage/key_string.h')
-rw-r--r--src/mongo/db/storage/key_string.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mongo/db/storage/key_string.h b/src/mongo/db/storage/key_string.h
index 74fd5fd4d91..d4e0aebb24b 100644
--- a/src/mongo/db/storage/key_string.h
+++ b/src/mongo/db/storage/key_string.h
@@ -557,6 +557,11 @@ public:
void appendSetAsArray(const BSONElementSet& set, const StringTransformFn& f = nullptr);
/**
+ * Appends a Discriminator byte and kEnd byte to a key string.
+ */
+ void appendDiscriminator(const Discriminator discriminator);
+
+ /**
* Resets to an empty state.
* Equivalent to but faster than *this = Builder(ord, discriminator)
*/
@@ -664,7 +669,6 @@ private:
void _appendDoubleWithoutTypeBits(const double num, DecimalContinuationMarker dcm, bool invert);
void _appendHugeDecimalWithoutTypeBits(const Decimal128 dec, bool invert);
void _appendTinyDecimalWithoutTypeBits(const Decimal128 dec, const double bin, bool invert);
- void _appendDiscriminator(const Discriminator discriminator);
void _appendEnd();
template <typename T>
@@ -676,7 +680,7 @@ private:
void _doneAppending() {
if (_state == BuildState::kAppendingBSONElements) {
- _appendDiscriminator(_discriminator);
+ appendDiscriminator(_discriminator);
}
}
@@ -697,7 +701,7 @@ private:
switch (_state) {
case BuildState::kEmpty:
- invariant(to == BuildState::kAppendingBSONElements ||
+ invariant(to == BuildState::kAppendingBSONElements || to == BuildState::kEndAdded ||
to == BuildState::kAppendedRecordID);
break;
case BuildState::kAppendingBSONElements: