diff options
author | Henning Baldersheim <balder@oath.com> | 2018-08-11 00:35:31 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-08-11 00:35:31 +0200 |
commit | e198573919f269bf62bb7ff22c0fb5797375ef9c (patch) | |
tree | 33b1c2b551290c70d6647c6c5b313758e5fe950c /searchcore | |
parent | 9f1d806d415b458b2139ce0cbf6b03a3ae979539 (diff) |
Pass stringref by value
Diffstat (limited to 'searchcore')
6 files changed, 7 insertions, 7 deletions
diff --git a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp index 0a520044985..56596ec5bb6 100644 --- a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp +++ b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp @@ -38,7 +38,7 @@ class MySearchHandler : public ISearchHandler { std::string _name; stringref _reply; public: - MySearchHandler(const std::string &name = "my", const stringref &reply = MYREPLY) + MySearchHandler(const std::string &name = "my", stringref reply = MYREPLY) : _name(name), _reply(reply) {} @@ -181,7 +181,7 @@ TEST("requireThatHandlersAreStored") { } bool -assertDocsumReply(SummaryEngine &engine, const std::string &searchDocType, const stringref &expReply) { +assertDocsumReply(SummaryEngine &engine, const std::string &searchDocType, stringref expReply) { DocsumRequest::UP request(createRequest()); request->propertiesMap.lookupCreate(search::MapNames::MATCH).add("documentdb.searchdoctype", searchDocType); MyDocsumClient client; diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/query.h b/searchcore/src/vespa/searchcore/fdispatch/search/query.h index 0e5d6008c36..315e087b4d7 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/query.h +++ b/searchcore/src/vespa/searchcore/fdispatch/search/query.h @@ -67,7 +67,7 @@ private: return (strcmp(a, b) == 0); } static bool cmp_str_ref(vespalib::stringref a, - const vespalib::stringref &b) + vespalib::stringref b) { return (a.size() == b.size() && memcmp(a.data(), b.data(), a.size()) == 0); diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp index fe10c1d51c3..055bc5fe1c2 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp @@ -147,7 +147,7 @@ MatchToolsFactory(QueryLimiter & queryLimiter, const vespalib::Doom & hardDoom, ISearchContext & searchContext, IAttributeContext & attributeContext, - const vespalib::stringref & queryStack, + vespalib::stringref queryStack, const vespalib::string & location, const ViewResolver & viewResolver, const IDocumentMetaStore & metaStore, diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h index 97baafb8bc3..0615c334628 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h +++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h @@ -92,7 +92,7 @@ public: const vespalib::Doom & hardDoom, ISearchContext &searchContext, search::attribute::IAttributeContext &attributeContext, - const vespalib::stringref &queryStack, + vespalib::stringref queryStack, const vespalib::string &location, const ViewResolver &viewResolver, const search::IDocumentMetaStore &metaStore, diff --git a/searchcore/src/vespa/searchcore/proton/matching/viewresolver.cpp b/searchcore/src/vespa/searchcore/proton/matching/viewresolver.cpp index d8676357633..87e6c4db12d 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/viewresolver.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/viewresolver.cpp @@ -7,7 +7,7 @@ namespace proton::matching { ViewResolver & ViewResolver::add(vespalib::stringref view, - const vespalib::stringref &field) + vespalib::stringref field) { _map[view].push_back(field); return *this; diff --git a/searchcore/src/vespa/searchcore/proton/matching/viewresolver.h b/searchcore/src/vespa/searchcore/proton/matching/viewresolver.h index 3899167ebc0..edff7a696c3 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/viewresolver.h +++ b/searchcore/src/vespa/searchcore/proton/matching/viewresolver.h @@ -35,7 +35,7 @@ public: * @param field the name of the field **/ ViewResolver &add(vespalib::stringref view, - const vespalib::stringref &field); + vespalib::stringref field); /** * Resolve a view to obtain the set of fields it |