summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-03-29 14:27:22 +0300
committerGitHub <noreply@github.com>2019-03-29 14:27:22 +0300
commit9a961e00ccbe97ad3af2de1b16d9afe66cd82dc4 (patch)
tree34f66f753f5cac02b15d0e44d87e9665208c4d86
parent1cc70a9ef77b5e1cb6d38ba0a45caf38640dfac1 (diff)
parent17330ec821b9e82ef0292c4c0315230bac8a047c (diff)
Merge pull request #8952 from vespa-engine/balder/avoid-creating-a-temporary-vector-when-you-only-need-one-element
Avoid a temporary vector for holding a single element when you only h…
-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();