diff options
Diffstat (limited to 'searchcore')
3 files changed, 5 insertions, 4 deletions
diff --git a/searchcore/src/tests/proton/matching/querynodes_test.cpp b/searchcore/src/tests/proton/matching/querynodes_test.cpp index 15fcc8a3fd7..3c9220bcdb8 100644 --- a/searchcore/src/tests/proton/matching/querynodes_test.cpp +++ b/searchcore/src/tests/proton/matching/querynodes_test.cpp @@ -520,9 +520,9 @@ TEST("requireThatSimpleIntermediatesGetProperBlending") { TEST("control query nodes size") { EXPECT_EQUAL(160u, sizeof(search::query::NumberTerm)); - EXPECT_EQUAL(192u, sizeof(ProtonNodeTypes::NumberTerm)); + EXPECT_EQUAL(280u, sizeof(ProtonNodeTypes::NumberTerm)); EXPECT_EQUAL(160u, sizeof(search::query::StringTerm)); - EXPECT_EQUAL(192u, sizeof(ProtonNodeTypes::StringTerm)); + EXPECT_EQUAL(280u, sizeof(ProtonNodeTypes::StringTerm)); } } // namespace diff --git a/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp b/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp index 03e15830ac5..68845cf7f7f 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp @@ -23,7 +23,7 @@ struct Mixer { Mixer() : attributes() {} void addAttribute(Blueprint::UP attr) { - if (attributes.get() == 0) { + if ( ! attributes) { attributes = std::make_unique<OrBlueprint>(); } attributes->addChild(std::move(attr)); @@ -62,6 +62,7 @@ private: void buildChildren(IntermediateBlueprint &parent, const std::vector<search::query::Node *> &children) { + parent.reserve(children.size()); for (size_t i = 0; i < children.size(); ++i) { parent.addChild(BlueprintBuilder::build(_requestContext, *children[i], _context)); } diff --git a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h index 03b274b7233..0e01884d504 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h +++ b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h @@ -44,7 +44,7 @@ public: }; private: - std::vector<FieldEntry> _fields; + vespalib::SmallVector<FieldEntry, 1u> _fields; void propagate_document_frequency(uint32_t matching_count_doc, uint32_t total_doc_count); |