diff options
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/commands/cpuload.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_index_format.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/query/optimizer/explain.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/storage/key_string.cpp | 7 |
4 files changed, 1 insertions, 14 deletions
diff --git a/src/mongo/db/commands/cpuload.cpp b/src/mongo/db/commands/cpuload.cpp index 23279a4b688..400cdc3a4d8 100644 --- a/src/mongo/db/commands/cpuload.cpp +++ b/src/mongo/db/commands/cpuload.cpp @@ -72,7 +72,7 @@ public: } long long limit = 10000 * cpuFactor; // volatile used to ensure that loop is not optimized away - volatile uint64_t lresult = 0; // NOLINT + volatile uint64_t lresult [[maybe_unused]] = 0; // NOLINT uint64_t x = 100; for (long long i = 0; i < limit; i++) { x *= 13; diff --git a/src/mongo/db/fts/fts_index_format.cpp b/src/mongo/db/fts/fts_index_format.cpp index cb7977cfdcd..3ae911ea641 100644 --- a/src/mongo/db/fts/fts_index_format.cpp +++ b/src/mongo/db/fts/fts_index_format.cpp @@ -116,7 +116,6 @@ void FTSIndexFormat::getKeys(SharedBufferFragmentBuilder& pooledBufferBuilder, KeyString::Version keyStringVersion, Ordering ordering, const boost::optional<RecordId>& id) { - int extraSize = 0; vector<BSONElement> extrasBefore; vector<BSONElement> extrasAfter; @@ -124,14 +123,12 @@ void FTSIndexFormat::getKeys(SharedBufferFragmentBuilder& pooledBufferBuilder, for (unsigned i = 0; i < spec.numExtraBefore(); i++) { auto indexedElement = extractNonFTSKeyElement(obj, spec.extraBefore(i)); extrasBefore.push_back(indexedElement); - extraSize += indexedElement.size(); } // Compute the non FTS key elements for the suffix. for (unsigned i = 0; i < spec.numExtraAfter(); i++) { auto indexedElement = extractNonFTSKeyElement(obj, spec.extraAfter(i)); extrasAfter.push_back(indexedElement); - extraSize += indexedElement.size(); } TermFrequencyMap term_freqs; diff --git a/src/mongo/db/query/optimizer/explain.cpp b/src/mongo/db/query/optimizer/explain.cpp index 4c55dffd6ed..a7100e20727 100644 --- a/src/mongo/db/query/optimizer/explain.cpp +++ b/src/mongo/db/query/optimizer/explain.cpp @@ -175,7 +175,6 @@ public: std::ostringstream os; std::vector<std::string> linePrefix; - bool firstAddLine = true; for (const auto& cmd : _cmd) { switch (cmd._type) { case CommandType::Indent: @@ -194,8 +193,6 @@ public: } } os << cmd._str << "\n"; - - firstAddLine = false; break; } diff --git a/src/mongo/db/storage/key_string.cpp b/src/mongo/db/storage/key_string.cpp index 0ba7f9c35af..1bb0ce8ac52 100644 --- a/src/mongo/db/storage/key_string.cpp +++ b/src/mongo/db/storage/key_string.cpp @@ -2000,10 +2000,6 @@ void readBson(BufReader* reader, bool inverted, Version version) { } void filterKeyFromKeyString(uint8_t ctype, BufReader* reader, bool inverted, Version version) { - // This is only used by the kNumeric.*ByteInt types, but needs to be declared up here - // since it is used across a fallthrough. - bool isNegative = false; - switch (ctype) { case CType::kMinKey: case CType::kMaxKey: @@ -2106,7 +2102,6 @@ void filterKeyFromKeyString(uint8_t ctype, BufReader* reader, bool inverted, Ver case CType::kNumericNegativeLargeMagnitude: inverted = !inverted; - isNegative = true; [[fallthrough]]; // format is the same as positive, but inverted case CType::kNumericPositiveLargeMagnitude: { uint64_t encoded = readType<uint64_t>(reader, inverted); @@ -2132,7 +2127,6 @@ void filterKeyFromKeyString(uint8_t ctype, BufReader* reader, bool inverted, Ver case CType::kNumericNegativeSmallMagnitude: inverted = !inverted; - isNegative = true; [[fallthrough]]; // format is the same as positive, but inverted case CType::kNumericPositiveSmallMagnitude: { @@ -2194,7 +2188,6 @@ void filterKeyFromKeyString(uint8_t ctype, BufReader* reader, bool inverted, Ver case CType::kNumericNegative2ByteInt: case CType::kNumericNegative1ByteInt: inverted = !inverted; - isNegative = true; [[fallthrough]]; // format is the same as positive, but inverted case CType::kNumericPositive1ByteInt: |