aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-04-26 10:33:37 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2024-04-26 10:33:37 +0000
commit8d8652b28eee50cc7c26dc12f8de1d4e474720ee (patch)
treee4cf5a2498935f1ddb5aadfe9128184d01911d6d
parentcc217a6619d8f6285e7a453fa38bb1e46c9243c0 (diff)
Use no_unique_address for scorer
-rw-r--r--searchlib/src/tests/queryeval/weak_and/rise_wand.h18
1 files 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<TermFreqScorer, std::greater_equal<uint64_t> >;
-using DotProductRiseWand = RiseWand<DotProductScorer, std::greater<uint64_t> >;
+using TermFrequencyRiseWand = RiseWand<TermFreqScorer, std::greater_equal<> >;
+using DotProductRiseWand = RiseWand<DotProductScorer, std::greater<> >;
} // namespacve rise