summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-03-29 08:45:32 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-03-29 08:45:32 +0000
commit17330ec821b9e82ef0292c4c0315230bac8a047c (patch)
tree7e9611dd69909482637a3921d2b414738cb770eb /searchlib
parent9bbf6145015c329b44d45a8bc449a10039a2a44f (diff)
Avoid a temporary vector for holding a single element when you only have one.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp7
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp3
2 files changed, 8 insertions, 2 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp
index f09f48363db..07689e5ffec 100644
--- a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp
@@ -115,6 +115,13 @@ public:
return _search_context->createIterator(tfmda[0], strict);
}
+ SearchIterator::UP
+ createSearch(fef::MatchData &md, bool strict) const override {
+ const State &state = getState();
+ assert(state.numFields() == 1);
+ return _search_context->createIterator(state.field(0).resolve(md), strict);
+ }
+
void
fetchPostings(bool strict) override {
_search_context->fetchPostings(strict);
diff --git a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp
index fc68c48a247..cec72129475 100644
--- a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp
@@ -44,8 +44,7 @@ WeightedSetTermBlueprint::addTerm(Blueprint::UP term, int32_t weight)
SearchIterator::UP
-WeightedSetTermBlueprint::createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda,
- bool) const
+WeightedSetTermBlueprint::createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool) const
{
assert(tfmda.size() == 1);
fef::MatchData::UP md = _layout.createMatchData();