From 3d3dda413a6e8b1f495d01f03cf3f1a99f3084b2 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Fri, 23 Sep 2022 14:36:10 +0200 Subject: Remove unused variables. --- searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp | 2 -- .../tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp | 2 -- searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp | 2 -- searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp | 2 +- searchlib/src/vespa/searchlib/transactionlog/ichunk.cpp | 2 +- 5 files changed, 2 insertions(+), 8 deletions(-) (limited to 'searchlib/src') diff --git a/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp b/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp index 6390e30adff..4d02ea7f61d 100644 --- a/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp +++ b/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp @@ -1144,13 +1144,11 @@ SearchContextTest::testRangeSearch(const AttributePtr & ptr, uint32_t numDocs, s //std::cout << "}" << std::endl; } ptr->commit(true); - uint32_t smallHits = 0; ValueType zeroValue = 0; bool smallUInt = isUnsignedSmallIntAttribute(vec); if (smallUInt) { for (uint32_t i = docCnt ; i < numDocs; ++i) { postingList[zeroValue].insert(i + 1u); - ++smallHits; } } diff --git a/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp b/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp index 6bda256f6d9..3700a68ff13 100644 --- a/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp +++ b/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp @@ -95,10 +95,8 @@ calcSegments(uint32_t maxLen) BitBuffer bb; PostingListCounts counts = makeBaseCounts(); uint32_t len = bb.getSize(counts); - unsigned int i = 0; while (len <= maxLen) { addSegment(counts); - ++i; len = bb.getSize(counts); } return counts._segments.size() - 1; diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp index 8d5f6d6db4e..e74f8ffd8e4 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp @@ -263,7 +263,6 @@ FakeZcFilterOcc::validate_read(const FakeWord &fw) const auto word_pos_iterator_end(fw._wordPosFeatures.end()); DocIdAndPosOccFeatures check_features; DocIdAndFeatures features; - uint32_t hits = 0; for (const auto &doc : fw._postings) { if (_posting_params._encode_features) { fw.setupFeatures(doc, &*word_pos_iterator, check_features); @@ -279,7 +278,6 @@ FakeZcFilterOcc::validate_read(const FakeWord &fw) const assert(features.field_length() == doc._collapsedDocWordFeatures._field_len); assert(features.num_occs() == doc._collapsedDocWordFeatures._num_occs); } - ++hits; } if (_posting_params._encode_features) { assert(word_pos_iterator == word_pos_iterator_end); diff --git a/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp b/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp index 00bbd5e81d2..edd53171510 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp @@ -166,7 +166,7 @@ DomainPart::readPacket(FastOS_FileInterface & transLog, SerialNumRange wanted, s Packet packet(targetSize); int64_t fSize(transLog.GetSize()); int64_t currPos(transLog.GetPosition()); - for(size_t i(0); (packet.sizeBytes() < targetSize) && (currPos < fSize) && (packet.range().to() < wanted.to()); i++) { + while ((packet.sizeBytes() < targetSize) && (currPos < fSize) && (packet.range().to() < wanted.to())) { IChunk::UP chunk; if (read(transLog, chunk, buf, allowTruncate)) { if (chunk) { diff --git a/searchlib/src/vespa/searchlib/transactionlog/ichunk.cpp b/searchlib/src/vespa/searchlib/transactionlog/ichunk.cpp index 2a4a042d967..83aeadb758e 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/ichunk.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/ichunk.cpp @@ -146,7 +146,7 @@ SerializedChunk::SerializedChunk(std::unique_ptr commitChunk, Encod IChunk::UP chunk = IChunk::create(encoding, compressionLevel); SerialNum prev = 0; - for (size_t i(0); h.size() > 0; i++) { + while (h.size() > 0) { //LOG(spam, //"Pos(%d) Len(%d), Lim(%d), Remaining(%d)", //h.getPos(), h.getLength(), h.getLimit(), h.getRemaining()); -- cgit v1.2.3