diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-08-15 12:50:33 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-08-15 12:50:33 +0000 |
commit | 2831803a3af7e8802fd34df881d74e39e6ad1e10 (patch) | |
tree | a058236e2260e153b0bb6afc6bafafbc253f6320 /searchlib | |
parent | 6dcfc6aaebc0d965c09e405069722631b785c9d1 (diff) |
Add clarifying comment.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp | 8 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp b/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp index d0951cbe2d3..0fef721a6fa 100644 --- a/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp +++ b/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp @@ -263,7 +263,10 @@ TEST_F("test Eager Matching Children", MockFixture(5)) { class IteratorChildrenVerifier : public search::test::IteratorChildrenVerifier { private: - SearchIterator::UP create(const std::vector<SearchIterator*> &children) const override { + SearchIterator::UP + create(const std::vector<SearchIterator*> &children) const override { + // This is a pragmatic and dirty workaround to make IteratorVerifier test + // not fail on unpack when accessing child match weights std::vector<fef::TermFieldMatchData*> no_child_match(children.size(), &_tfmd); MatchData::UP no_match_data; return DotProductSearch::create(children, _tfmd, false, no_child_match, _weights, std::move(no_match_data)); @@ -272,7 +275,8 @@ private: class WeightIteratorChildrenVerifier : public search::test::DwaIteratorChildrenVerifier { private: - SearchIterator::UP create(std::vector<DocumentWeightIterator> && children) const override { + SearchIterator::UP + create(std::vector<DocumentWeightIterator> && children) const override { return DotProductSearch::create(_tfmd, false, _weights, std::move(children)); } }; diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp index 393140784b0..34cc343b16d 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp @@ -169,9 +169,9 @@ DotProductSearch::create(const std::vector<SearchIterator*> &children, *childMatch[0], weights[0], std::move(md)); } if (childMatch.size() < 128) { - return SearchIterator::UP(new ArrayHeapImpl(tmd, field_is_filter, weights, SearchIteratorPack(children, childMatch, std::move(md)))); + return std::make_unique<ArrayHeapImpl>(tmd, field_is_filter, weights, SearchIteratorPack(children, childMatch, std::move(md))); } - return SearchIterator::UP(new HeapImpl(tmd, field_is_filter, weights, SearchIteratorPack(children, childMatch, std::move(md)))); + return std::make_unique<HeapImpl>(tmd, field_is_filter, weights, SearchIteratorPack(children, childMatch, std::move(md))); } //----------------------------------------------------------------------------- @@ -186,9 +186,9 @@ DotProductSearch::create(TermFieldMatchData &tmd, typedef DotProductSearchImpl<vespalib::LeftHeap, AttributeIteratorPack> HeapImpl; if (iterators.size() < 128) { - return SearchIterator::UP(new ArrayHeapImpl(tmd, field_is_filter, weights, AttributeIteratorPack(std::move(iterators)))); + return std::make_unique<ArrayHeapImpl>(tmd, field_is_filter, weights, AttributeIteratorPack(std::move(iterators))); } - return SearchIterator::UP(new HeapImpl(tmd, field_is_filter, weights, AttributeIteratorPack(std::move(iterators)))); + return std::make_unique<HeapImpl>(tmd, field_is_filter, weights, AttributeIteratorPack(std::move(iterators))); } //----------------------------------------------------------------------------- |