diff options
author | Tor Egge <Tor.Egge@online.no> | 2022-09-23 14:36:10 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2022-09-23 14:36:10 +0200 |
commit | 3d3dda413a6e8b1f495d01f03cf3f1a99f3084b2 (patch) | |
tree | 566917bb676491fa567607f4697ac28fa95215ee | |
parent | e3a7b619b4bedee9ff126085f17de43688547f90 (diff) |
Remove unused variables.
8 files changed, 5 insertions, 23 deletions
diff --git a/document/src/vespa/document/select/CMakeLists.txt b/document/src/vespa/document/select/CMakeLists.txt index 11a62fbb9c8..ef486757ea7 100644 --- a/document/src/vespa/document/select/CMakeLists.txt +++ b/document/src/vespa/document/select/CMakeLists.txt @@ -48,4 +48,6 @@ vespa_add_library(document_select OBJECT set_source_files_properties(${FLEX_DocSelLexer_OUTPUTS} PROPERTIES COMPILE_FLAGS -Wno-register) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set_source_files_properties(${BISON_DocSelParser_OUTPUTS} PROPERTIES COMPILE_FLAGS -Wno-noexcept) +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0) + set_source_files_properties(${BISON_DocSelParser_OUTPUTS} PROPERTIES COMPILE_OPTIONS "-Wno-unused-but-set-variable") endif() diff --git a/eval/src/tests/ann/xp-lsh-nns.cpp b/eval/src/tests/ann/xp-lsh-nns.cpp index 1557da0b84c..13a0c37941c 100644 --- a/eval/src/tests/ann/xp-lsh-nns.cpp +++ b/eval/src/tests/ann/xp-lsh-nns.cpp @@ -208,23 +208,16 @@ RpLshNns::topKfilter(uint32_t k, Vector vector, uint32_t search_k, const BitVect LsMaskHash query_hash = mask_hash_from_pv(vector, _transformationMatrix); LshHitHeap heap(std::max(k, search_k)); int limit_hash_dist = 99999; - int skipCnt = 0; - int fullCnt = 0; - int whdcCnt = 0; size_t docidLimit = _generated_doc_hashes.size(); for (uint32_t docid = 0; docid < docidLimit; ++docid) { if (skipDocIds.isSet(docid)) continue; int hd = hash_dist(query_hash, _generated_doc_hashes[docid]); if (hd <= limit_hash_dist) { - ++fullCnt; double dist = l2distCalc.l2sq_dist(vector, _dva.get(docid), tmpArr); LshHit h(docid, dist, hd); if (heap.maybe_use(h)) { - ++whdcCnt; limit_hash_dist = heap.limitHashDistance(); } - } else { - ++skipCnt; } } std::vector<LshHit> best = heap.bestLshHits(); @@ -248,24 +241,17 @@ RpLshNns::topK(uint32_t k, Vector vector, uint32_t search_k) LshHitHeap heap(std::max(k, search_k)); int limit_hash_dist = 99999; int histogram[HIST_SIZE]; - int skipCnt = 0; - int fullCnt = 0; - int whdcCnt = 0; memset(histogram, 0, sizeof histogram); size_t docidLimit = _generated_doc_hashes.size(); for (uint32_t docid = 0; docid < docidLimit; ++docid) { int hd = hash_dist(query_hash, _generated_doc_hashes[docid]); histogram[hd]++; if (hd <= limit_hash_dist) { - ++fullCnt; double dist = l2distCalc.l2sq_dist(vector, _dva.get(docid), tmpArr); LshHit h(docid, dist, hd); if (heap.maybe_use(h)) { - ++whdcCnt; limit_hash_dist = heap.limitHashDistance(); } - } else { - ++skipCnt; } } std::vector<LshHit> best = heap.bestLshHits(); 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> 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()); diff --git a/vespamalloc/src/vespamalloc/util/osmem.cpp b/vespamalloc/src/vespamalloc/util/osmem.cpp index 2cb0eb78ad2..0267e091bab 100644 --- a/vespamalloc/src/vespamalloc/util/osmem.cpp +++ b/vespamalloc/src/vespamalloc/util/osmem.cpp @@ -115,7 +115,7 @@ MmapMemory::setupHugePages() ASSERT_STACKTRACE((sz < int(sizeof(mounts))) && (sz >= 0)); (void) sz; const char * c = mounts; - for (size_t lineNo(0); *c; lineNo++) { + while (*c) { const char *e = c; for (; e[0] && (e[0] != '\n'); e++) { } const char *dev = getToken(c, e); |