From 8d8652b28eee50cc7c26dc12f8de1d4e474720ee Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 26 Apr 2024 10:33:37 +0000 Subject: Use no_unique_address for scorer --- searchlib/src/tests/queryeval/weak_and/rise_wand.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/searchlib/src/tests/queryeval/weak_and/rise_wand.h b/searchlib/src/tests/queryeval/weak_and/rise_wand.h index 057cfec1b5d..fc060f7c469 100644 --- a/searchlib/src/tests/queryeval/weak_and/rise_wand.h +++ b/searchlib/src/tests/queryeval/weak_and/rise_wand.h @@ -15,14 +15,14 @@ namespace rise { struct TermFreqScorer { - TermFrequencyScorer _termFrequencyScorer; + [[no_unique_address]] TermFrequencyScorer _termFrequencyScorer; TermFreqScorer() noexcept : _termFrequencyScorer() { } - int64_t calculateMaxScore(const wand::Term &term) { + int64_t calculateMaxScore(const wand::Term &term) const noexcept { return _termFrequencyScorer.calculateMaxScore(term); } - int64_t calculateScore(const wand::Term &term, uint32_t docId) { + static int64_t calculateScore(const wand::Term &term, uint32_t docId) { term.search->unpack(docId); return term.maxScore; } @@ -95,7 +95,7 @@ private: * * @return whether a valid pivot index is found */ - bool _findPivotFeatureIdx(const score_t threshold, uint32_t &pivotIdx); + bool _findPivotFeatureIdx(score_t threshold, uint32_t &pivotIdx); /** * let the first numStreamsToMove streams in the stream @@ -103,7 +103,7 @@ private: * * @param numStreamsToMove the number of streams that should move */ - void _moveStreamsAndSort(const uint32_t numStreamsToMove); + void _moveStreamsAndSort(uint32_t numStreamsToMove); /** * let the first numStreamsToMove streams in the stream @@ -115,7 +115,7 @@ private: * @param desiredDocId desired doc id * */ - void _moveStreamsToDocAndSort(const uint32_t numStreamsToMove, const docid_t desiredDocId); + void _moveStreamsToDocAndSort(uint32_t numStreamsToMove, docid_t desiredDocId); /** * do sort and merge for WAND @@ -124,7 +124,7 @@ private: * be sorted and then merge sort with the rest * */ - void _sortMerge(const uint32_t numStreamsToSort); + void _sortMerge(uint32_t numStreamsToSort); public: RiseWand(const Terms &terms, uint32_t n); @@ -134,8 +134,8 @@ public: void doUnpack(uint32_t docid) override; }; -using TermFrequencyRiseWand = RiseWand >; -using DotProductRiseWand = RiseWand >; +using TermFrequencyRiseWand = RiseWand >; +using DotProductRiseWand = RiseWand >; } // namespacve rise -- cgit v1.2.3