diff options
author | Henning Baldersheim <balder@oath.com> | 2018-08-11 00:36:04 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-08-11 00:36:04 +0200 |
commit | 9bc10130d366f8a63549446cd730c739a9cc5a0c (patch) | |
tree | de2432a14bce2dc5f0f298c8b8aac38698338668 /searchlib | |
parent | bb54ccd7a3422f9f3835d71dc71bded0a766fd88 (diff) |
Pass stringref by value
Diffstat (limited to 'searchlib')
30 files changed, 102 insertions, 102 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp index 9fd70ddea77..fbeaaa6070c 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp @@ -59,8 +59,8 @@ namespace search { IMPLEMENT_IDENTIFIABLE_ABSTRACT(AttributeVector, vespalib::Identifiable); AttributeVector::BaseName::BaseName(vespalib::stringref base, - const vespalib::stringref &snap, - const vespalib::stringref &name) + vespalib::stringref snap, + vespalib::stringref name) : string(base), _name(name) { diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h index 72a595319a1..53736a62572 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.h +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h @@ -138,8 +138,8 @@ public: } BaseName(vespalib::stringref base, - const vespalib::stringref &snap, - const vespalib::stringref &name); + vespalib::stringref snap, + vespalib::stringref name); ~BaseName(); string getIndexName() const; diff --git a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp index 5d1fec2f65d..ddf617d37ed 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp @@ -102,7 +102,7 @@ typedef PageDict4StartOffset StartOffset; static uint32_t getLCP(vespalib::stringref word, - const vespalib::stringref &prevWord) + vespalib::stringref prevWord) { size_t len1 = word.size(); size_t len2 = prevWord.size(); @@ -1327,9 +1327,9 @@ void PageDict4SPLookupRes:: lookup(const SSReader &ssReader, const void *sparsePage, - const vespalib::stringref &key, - const vespalib::stringref &l6Word, - const vespalib::stringref &lastSPWord, + vespalib::stringref key, + vespalib::stringref l6Word, + vespalib::stringref lastSPWord, const StartOffset &l6StartOffset, uint64_t l6WordNum, uint64_t lowestPageNum) @@ -1525,9 +1525,9 @@ bool PageDict4PLookupRes:: lookup(const SSReader &ssReader, const void *page, - const vespalib::stringref &key, - const vespalib::stringref &l3Word, - const vespalib::stringref &lastPWord, + vespalib::stringref key, + vespalib::stringref l3Word, + vespalib::stringref lastPWord, const StartOffset &l3StartOffset, uint64_t l3WordNum) { diff --git a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h index 1669d45e33a..dc0ea3a5201 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h +++ b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h @@ -610,9 +610,9 @@ public: void lookup(const SSReader &ssReader, const void *sparsePage, - const vespalib::stringref &key, - const vespalib::stringref &l6Word, - const vespalib::stringref &lastSPWord, + vespalib::stringref key, + vespalib::stringref l6Word, + vespalib::stringref lastSPWord, const StartOffset &l6StartOffset, uint64_t l6WordNum, uint64_t lowestPageNum); @@ -641,9 +641,9 @@ public: bool lookup(const SSReader &ssReader, const void *page, - const vespalib::stringref &key, - const vespalib::stringref &l3Word, - const vespalib::stringref &lastPWord, + vespalib::stringref key, + vespalib::stringref l3Word, + vespalib::stringref lastPWord, const StartOffset &l3StartOffset, uint64_t l3WordNum); }; diff --git a/searchlib/src/vespa/searchlib/common/packets.cpp b/searchlib/src/vespa/searchlib/common/packets.cpp index 90157e318e9..e7ec0ffc9b9 100644 --- a/searchlib/src/vespa/searchlib/common/packets.cpp +++ b/searchlib/src/vespa/searchlib/common/packets.cpp @@ -239,7 +239,7 @@ FS4Properties::allocEntries(uint32_t cnt) _backing.reserve(cnt*2*40); // Assume strings are average 40 bytes } -void FS4Properties::set(StringRef & e, const vespalib::stringref & s) +void FS4Properties::set(StringRef & e, vespalib::stringref s) { e.first = _backing.size(); e.second = s.size(); diff --git a/searchlib/src/vespa/searchlib/common/packets.h b/searchlib/src/vespa/searchlib/common/packets.h index 0a98bf87de8..3fd87ccfa25 100644 --- a/searchlib/src/vespa/searchlib/common/packets.h +++ b/searchlib/src/vespa/searchlib/common/packets.h @@ -165,7 +165,7 @@ private: vespalib::string _name; vespalib::string _backing; const char * c_str(size_t sz) const { return _backing.c_str() + sz; } - void set(StringRef & e, const vespalib::stringref & s); + void set(StringRef & e, vespalib::stringref s); public: FS4Properties(FS4Properties &&); FS4Properties &operator=(FS4Properties &&); @@ -178,11 +178,11 @@ public: setName(val.data(), val.size()); } void setKey(uint32_t entry, const char *key, uint32_t keySize); - void setKey(uint32_t entry, const vespalib::stringref &val) { + void setKey(uint32_t entry, vespalib::stringref val) { setKey(entry, val.data(), val.size()); } void setValue(uint32_t entry, const char *value, uint32_t valueSize); - void setValue(uint32_t entry, const vespalib::stringref &val) { + void setValue(uint32_t entry, vespalib::stringref val) { setValue(entry, val.data(), val.size()); } uint32_t size() const { return _entries.size(); } diff --git a/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp b/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp index 98f53da9858..e2fb7367b94 100644 --- a/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp @@ -199,7 +199,7 @@ DiskIndex::setup(const TuneFileSearch &tuneFileSearch, } DiskIndex::LookupResult::UP -DiskIndex::lookup(uint32_t index, const vespalib::stringref & word) +DiskIndex::lookup(uint32_t index, vespalib::stringref word) { /** Only used for testing */ IndexList indexes; @@ -252,7 +252,7 @@ unite(const DiskIndex::IndexList & indexes, const DiskIndex::LookupResultVector } DiskIndex::LookupResultVector -DiskIndex::lookup(const std::vector<uint32_t> & indexes, const vespalib::stringref & word) +DiskIndex::lookup(const std::vector<uint32_t> & indexes, vespalib::stringref word) { Key key(indexes, word); LookupResultVector result; diff --git a/searchlib/src/vespa/searchlib/diskindex/diskindex.h b/searchlib/src/vespa/searchlib/diskindex/diskindex.h index eaeb768cc9a..dd3daab34cd 100644 --- a/searchlib/src/vespa/searchlib/diskindex/diskindex.h +++ b/searchlib/src/vespa/searchlib/diskindex/diskindex.h @@ -111,8 +111,8 @@ public: * @param word the word to lookup. * @return the lookup result or NULL if the word is not found. **/ - LookupResult::UP lookup(uint32_t indexId, const vespalib::stringref & word); - LookupResultVector lookup(const std::vector<uint32_t> & indexes, const vespalib::stringref & word); + LookupResult::UP lookup(uint32_t indexId, vespalib::stringref word); + LookupResultVector lookup(const std::vector<uint32_t> & indexes, vespalib::stringref word); /** diff --git a/searchlib/src/vespa/searchlib/diskindex/fieldwriter.cpp b/searchlib/src/vespa/searchlib/diskindex/fieldwriter.cpp index d62b69c5bf5..ab90a1dacc5 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fieldwriter.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/fieldwriter.cpp @@ -121,7 +121,7 @@ FieldWriter::flush() void -FieldWriter::newWord(uint64_t wordNum, const vespalib::stringref &word) +FieldWriter::newWord(uint64_t wordNum, vespalib::stringref word) { assert(wordNum <= _numWordIds); assert(wordNum != noWordNum()); diff --git a/searchlib/src/vespa/searchlib/diskindex/fieldwriter.h b/searchlib/src/vespa/searchlib/diskindex/fieldwriter.h index f0dc033b01e..74f515958fe 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fieldwriter.h +++ b/searchlib/src/vespa/searchlib/diskindex/fieldwriter.h @@ -58,7 +58,7 @@ public: FieldWriter(uint32_t docIdLimit, uint64_t numWordIds); ~FieldWriter(); - void newWord(uint64_t wordNum, const vespalib::stringref &word); + void newWord(uint64_t wordNum, vespalib::stringref word); void newWord(vespalib::stringref word); void add(const DocIdAndFeatures &features) { diff --git a/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp b/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp index 93f1d9c0d51..0f360d99247 100644 --- a/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp +++ b/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp @@ -13,7 +13,7 @@ using vespalib::compression::decompress; using vespalib::compression::computeMaxCompressedsize; using vespalib::compression::CompressionConfig; -ChunkException::ChunkException(const vespalib::string & msg, const vespalib::stringref & location) : +ChunkException::ChunkException(const vespalib::string & msg, vespalib::stringref location) : Exception(make_string("Illegal chunk: %s", msg.c_str()), location) { } diff --git a/searchlib/src/vespa/searchlib/docstore/chunkformat.h b/searchlib/src/vespa/searchlib/docstore/chunkformat.h index 81feaf2a27f..ede1a02f0f4 100644 --- a/searchlib/src/vespa/searchlib/docstore/chunkformat.h +++ b/searchlib/src/vespa/searchlib/docstore/chunkformat.h @@ -12,7 +12,7 @@ namespace search { class ChunkException : public vespalib::Exception { public: - ChunkException(const vespalib::string & msg, const vespalib::stringref & location); + ChunkException(const vespalib::string & msg, vespalib::stringref location); }; // This is an interface for implementing a chunk format diff --git a/searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp b/searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp index 0c8ae805c46..80510dbe883 100644 --- a/searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp +++ b/searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp @@ -10,7 +10,7 @@ namespace search { SummaryException::SummaryException(vespalib::stringref msg, FastOS_FileInterface &file, - const vespalib::stringref &location) + vespalib::stringref location) : IoException(make_string("%s : Failing file = '%s'. Reason given by OS = '%s'", vespalib::string(msg).c_str(), file.GetFileName(), file.getLastErrorString().c_str()), getErrorType(file.GetLastError()), location) diff --git a/searchlib/src/vespa/searchlib/docstore/summaryexceptions.h b/searchlib/src/vespa/searchlib/docstore/summaryexceptions.h index 58e441f0a08..a9e8f3ca763 100644 --- a/searchlib/src/vespa/searchlib/docstore/summaryexceptions.h +++ b/searchlib/src/vespa/searchlib/docstore/summaryexceptions.h @@ -11,7 +11,7 @@ namespace search { class SummaryException : public vespalib::IoException { public: - SummaryException(vespalib::stringref msg, FastOS_FileInterface & file, const vespalib::stringref &location); + SummaryException(vespalib::stringref msg, FastOS_FileInterface & file, vespalib::stringref location); }; } // namespace search diff --git a/searchlib/src/vespa/searchlib/expression/catserializer.cpp b/searchlib/src/vespa/searchlib/expression/catserializer.cpp index f613bd16a54..2d64f3db9f9 100644 --- a/searchlib/src/vespa/searchlib/expression/catserializer.cpp +++ b/searchlib/src/vespa/searchlib/expression/catserializer.cpp @@ -14,7 +14,7 @@ using vespalib::Deserializer; using vespalib::string; using vespalib::stringref; -CatSerializer & CatSerializer::put(const IFieldBase & field, const stringref & value) +CatSerializer & CatSerializer::put(const IFieldBase & field, stringref value) { (void) field; getStream().write(value.data(), value.size()); diff --git a/searchlib/src/vespa/searchlib/expression/catserializer.h b/searchlib/src/vespa/searchlib/expression/catserializer.h index b635826fbf5..cce4af3880b 100644 --- a/searchlib/src/vespa/searchlib/expression/catserializer.h +++ b/searchlib/src/vespa/searchlib/expression/catserializer.h @@ -14,7 +14,7 @@ class CatSerializer : public vespalib::NBOSerializer, public ResultSerializer public: CatSerializer(vespalib::nbostream & stream) : vespalib::NBOSerializer(stream) { } CatSerializer & put(const vespalib::IFieldBase & field, const vespalib::Identifiable & value) override; - CatSerializer & put(const vespalib::IFieldBase & field, const vespalib::stringref & value) override; + CatSerializer & put(const vespalib::IFieldBase & field, vespalib::stringref value) override; ResultSerializer & putResult(const vespalib::IFieldBase & field, const RawResultNode & value) override; ResultSerializer & putResult(const vespalib::IFieldBase & field, const ResultNodeVector & value) override; void proxyPut(const ResultNode & value) override; diff --git a/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.cpp b/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.cpp index fb0a467abb2..a072e06d811 100644 --- a/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.cpp @@ -40,7 +40,7 @@ StringBucketResultNode::StringBucketResultNode() : _from(new StringResultNode()), _to(new StringResultNode()) {} -StringBucketResultNode::StringBucketResultNode(vespalib::stringref from, const vespalib::stringref & to) +StringBucketResultNode::StringBucketResultNode(vespalib::stringref from, vespalib::stringref to) : _from(new StringResultNode(from)), _to(new StringResultNode(to)) {} diff --git a/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.h b/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.h index 9c8417214c2..c53fa06487c 100644 --- a/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.h +++ b/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.h @@ -23,7 +23,7 @@ public: DECLARE_EXPRESSIONNODE(StringBucketResultNode); DECLARE_NBO_SERIALIZE; StringBucketResultNode(); - StringBucketResultNode(vespalib::stringref from, const vespalib::stringref & to); + StringBucketResultNode(vespalib::stringref from, vespalib::stringref to); StringBucketResultNode(ResultNode::UP from, ResultNode::UP to) : _from(from.release()), _to(to.release()) {} ~StringBucketResultNode(); size_t hash() const override; @@ -32,7 +32,7 @@ public: int contains(const ConstBufferRef & v) const { return contains(v.c_str()); } int contains(const char * v) const; void visitMembers(vespalib::ObjectVisitor &visitor) const override; - StringBucketResultNode &setRange(vespalib::stringref from, const vespalib::stringref & to) { + StringBucketResultNode &setRange(vespalib::stringref from, vespalib::stringref to) { _from.reset(new StringResultNode(from)); _to.reset(new StringResultNode(to)); return *this; diff --git a/searchlib/src/vespa/searchlib/features/dotproductfeature.h b/searchlib/src/vespa/searchlib/features/dotproductfeature.h index c12b0f54cf6..61fb418636d 100644 --- a/searchlib/src/vespa/searchlib/features/dotproductfeature.h +++ b/searchlib/src/vespa/searchlib/features/dotproductfeature.h @@ -73,7 +73,7 @@ public: **/ class IntegerVector : public VectorBase<int64_t, int64_t, feature_t> { public: - void insert(vespalib::stringref label, const vespalib::stringref & value) { + void insert(vespalib::stringref label, vespalib::stringref value) { _vector.push_back(std::make_pair(util::strToNum<int64_t>(label), util::strToNum<feature_t>(value))); } }; @@ -85,7 +85,7 @@ class StringVector : public VectorBase<vespalib::string, const char *, feature_t public: StringVector(); ~StringVector(); - void insert(vespalib::stringref label, const vespalib::stringref & value) { + void insert(vespalib::stringref label, vespalib::stringref value) { _vector.push_back(std::make_pair(label, util::strToNum<feature_t>(value))); } }; @@ -98,7 +98,7 @@ private: const search::attribute::IAttributeVector * _attribute; public: EnumVector(const search::attribute::IAttributeVector * attribute) : _attribute(attribute) {} - void insert(vespalib::stringref label, const vespalib::stringref & value) { + void insert(vespalib::stringref label, vespalib::stringref value) { search::attribute::EnumHandle e; if (_attribute->findEnum(label.data(), e)) { _vector.push_back(std::make_pair(e, util::strToNum<feature_t>(value))); diff --git a/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.cpp b/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.cpp index 7fdd216d447..3b0bde8f76f 100644 --- a/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.cpp @@ -36,7 +36,7 @@ namespace { struct WeightedStringVector { std::vector<IAttributeVector::WeightedString> _data; - void insert(vespalib::stringref key, const vespalib::stringref &weight) { + void insert(vespalib::stringref key, vespalib::stringref weight) { _data.emplace_back(key, util::strToNum<int32_t>(weight)); } }; diff --git a/searchlib/src/vespa/searchlib/fef/blueprint.cpp b/searchlib/src/vespa/searchlib/fef/blueprint.cpp index 82e9a316321..4e1ccee99c4 100644 --- a/searchlib/src/vespa/searchlib/fef/blueprint.cpp +++ b/searchlib/src/vespa/searchlib/fef/blueprint.cpp @@ -19,7 +19,7 @@ Blueprint::defineInput(vespalib::stringref inName, void Blueprint::describeOutput(vespalib::stringref outName, - const vespalib::stringref &desc, + vespalib::stringref desc, const FeatureType &type) { (void) desc; diff --git a/searchlib/src/vespa/searchlib/fef/blueprint.h b/searchlib/src/vespa/searchlib/fef/blueprint.h index 7ac2d648cc1..617edbd0613 100644 --- a/searchlib/src/vespa/searchlib/fef/blueprint.h +++ b/searchlib/src/vespa/searchlib/fef/blueprint.h @@ -97,7 +97,7 @@ protected: * @param outName output name * @param desc output description **/ - void describeOutput(vespalib::stringref outName, const vespalib::stringref &desc, + void describeOutput(vespalib::stringref outName, vespalib::stringref desc, const FeatureType &type = FeatureType::number()); public: diff --git a/searchlib/src/vespa/searchlib/fef/properties.cpp b/searchlib/src/vespa/searchlib/fef/properties.cpp index 280f9b3eaec..626623a8647 100644 --- a/searchlib/src/vespa/searchlib/fef/properties.cpp +++ b/searchlib/src/vespa/searchlib/fef/properties.cpp @@ -84,7 +84,7 @@ Properties::~Properties() } Properties & -Properties::add(vespalib::stringref key, const vespalib::stringref &value) +Properties::add(vespalib::stringref key, vespalib::stringref value) { if (!key.empty()) { Value & v = _data[key]; @@ -218,7 +218,7 @@ Properties::lookup(vespalib::stringref key) const } Property Properties::lookup(vespalib::stringref namespace1, - const vespalib::stringref &key) const + vespalib::stringref key) const { if (namespace1.empty() || key.empty()) @@ -229,8 +229,8 @@ Property Properties::lookup(vespalib::stringref namespace1, } Property Properties::lookup(vespalib::stringref namespace1, - const vespalib::stringref &namespace2, - const vespalib::stringref &key) const + vespalib::stringref namespace2, + vespalib::stringref key) const { if (namespace1.empty() || namespace2.empty() || @@ -242,9 +242,9 @@ Property Properties::lookup(vespalib::stringref namespace1, } Property Properties::lookup(vespalib::stringref namespace1, - const vespalib::stringref &namespace2, - const vespalib::stringref &namespace3, - const vespalib::stringref &key) const + vespalib::stringref namespace2, + vespalib::stringref namespace3, + vespalib::stringref key) const { if (namespace1.empty() || namespace2.empty() || diff --git a/searchlib/src/vespa/searchlib/fef/properties.h b/searchlib/src/vespa/searchlib/fef/properties.h index 9814e3023b5..1cbc0ba9064 100644 --- a/searchlib/src/vespa/searchlib/fef/properties.h +++ b/searchlib/src/vespa/searchlib/fef/properties.h @@ -167,7 +167,7 @@ public: * @param key the key * @param value the value **/ - Properties &add(vespalib::stringref key, const vespalib::stringref &value); + Properties &add(vespalib::stringref key, vespalib::stringref value); /** * Obtain the number of values for a given key. @@ -272,7 +272,7 @@ public: * @param key the key to look up **/ Property lookup(vespalib::stringref namespace1, - const vespalib::stringref &key) const; + vespalib::stringref key) const; /** * Look up a key inside a namespace using the proposed namespace @@ -287,8 +287,8 @@ public: * @param key the key to look up **/ Property lookup(vespalib::stringref namespace1, - const vespalib::stringref &namespace2, - const vespalib::stringref &key) const; + vespalib::stringref namespace2, + vespalib::stringref key) const; /** * Look up a key inside a namespace using the proposed namespace @@ -304,9 +304,9 @@ public: * @param key the key to look up **/ Property lookup(vespalib::stringref namespace1, - const vespalib::stringref &namespace2, - const vespalib::stringref &namespace3, - const vespalib::stringref &key) const; + vespalib::stringref namespace2, + vespalib::stringref namespace3, + vespalib::stringref key) const; void swap(Properties & rhs); }; diff --git a/searchlib/src/vespa/searchlib/parsequery/parse.cpp b/searchlib/src/vespa/searchlib/parsequery/parse.cpp index 60236275f76..cc6fd6ee915 100644 --- a/searchlib/src/vespa/searchlib/parsequery/parse.cpp +++ b/searchlib/src/vespa/searchlib/parsequery/parse.cpp @@ -58,7 +58,7 @@ void assert_type(ParseItem::ItemType type) } -ParseItem::ParseItem(ItemType type, const vespalib::stringref & idx, const char *term) +ParseItem::ParseItem(ItemType type, vespalib::stringref idx, const char *term) : PARSEITEM_DEFAULT_CONSTRUCTOR_LIST { assert_type(type); diff --git a/searchlib/src/vespa/searchlib/parsequery/parse.h b/searchlib/src/vespa/searchlib/parsequery/parse.h index d8cbdc696a5..15fb0e316e8 100644 --- a/searchlib/src/vespa/searchlib/parsequery/parse.h +++ b/searchlib/src/vespa/searchlib/parsequery/parse.h @@ -166,7 +166,7 @@ public: * @param idx The name of the index of the ParseItem. * @param term The actual term string of the ParseItem. */ - ParseItem(ItemType type, const vespalib::stringref & index, const char *term); + ParseItem(ItemType type, vespalib::stringref index, const char *term); /** * Overloaded constructor for ParseItem. Used for TERMs without index. diff --git a/searchlib/src/vespa/searchlib/predicate/document_features_store.h b/searchlib/src/vespa/searchlib/predicate/document_features_store.h index 5fa8e36e7de..73bd8c11f7a 100644 --- a/searchlib/src/vespa/searchlib/predicate/document_features_store.h +++ b/searchlib/src/vespa/searchlib/predicate/document_features_store.h @@ -39,7 +39,7 @@ class DocumentFeaturesStore { } public: - KeyComp(const WordStore &word_store, const vespalib::stringref &word) + KeyComp(const WordStore &word_store, vespalib::stringref word) : _word_store(word_store), _word(word) { } diff --git a/searchlib/src/vespa/searchlib/query/tree/querybuilder.h b/searchlib/src/vespa/searchlib/query/tree/querybuilder.h index 3a96de83a71..a2ad8eae84b 100644 --- a/searchlib/src/vespa/searchlib/query/tree/querybuilder.h +++ b/searchlib/src/vespa/searchlib/query/tree/querybuilder.h @@ -110,7 +110,7 @@ template <class NodeTypes> typename NodeTypes::Or *createOr() { return new typename NodeTypes::Or; } template <class NodeTypes> -typename NodeTypes::WeakAnd *createWeakAnd(uint32_t minHits, const vespalib::stringref & view) { +typename NodeTypes::WeakAnd *createWeakAnd(uint32_t minHits, vespalib::stringref view) { return new typename NodeTypes::WeakAnd(minHits, view); } template <class NodeTypes> @@ -155,50 +155,50 @@ typename NodeTypes::ONear *createONear(size_t distance) { // Term nodes template <class NodeTypes> typename NodeTypes::NumberTerm * -createNumberTerm(vespalib::stringref term, const vespalib::stringref &view, int32_t id, Weight weight) { +createNumberTerm(vespalib::stringref term, vespalib::stringref view, int32_t id, Weight weight) { return new typename NodeTypes::NumberTerm(term, view, id, weight); } template <class NodeTypes> typename NodeTypes::PrefixTerm * -createPrefixTerm(vespalib::stringref term, const vespalib::stringref &view, int32_t id, Weight weight) { +createPrefixTerm(vespalib::stringref term, vespalib::stringref view, int32_t id, Weight weight) { return new typename NodeTypes::PrefixTerm(term, view, id, weight); } template <class NodeTypes> typename NodeTypes::RangeTerm * -createRangeTerm(const Range &term, const vespalib::stringref &view, int32_t id, Weight weight) { +createRangeTerm(const Range &term, vespalib::stringref view, int32_t id, Weight weight) { return new typename NodeTypes::RangeTerm(term, view, id, weight); } template <class NodeTypes> typename NodeTypes::StringTerm * -createStringTerm(vespalib::stringref term, const vespalib::stringref &view, int32_t id, Weight weight) { +createStringTerm(vespalib::stringref term, vespalib::stringref view, int32_t id, Weight weight) { return new typename NodeTypes::StringTerm(term, view, id, weight); } template <class NodeTypes> typename NodeTypes::SubstringTerm * -createSubstringTerm(vespalib::stringref term, const vespalib::stringref &view, int32_t id, Weight weight) { +createSubstringTerm(vespalib::stringref term, vespalib::stringref view, int32_t id, Weight weight) { return new typename NodeTypes::SubstringTerm(term, view, id, weight); } template <class NodeTypes> typename NodeTypes::SuffixTerm * -createSuffixTerm(vespalib::stringref term, const vespalib::stringref &view, int32_t id, Weight weight) { +createSuffixTerm(vespalib::stringref term, vespalib::stringref view, int32_t id, Weight weight) { return new typename NodeTypes::SuffixTerm(term, view, id, weight); } template <class NodeTypes> typename NodeTypes::LocationTerm * -createLocationTerm(const Location &loc, const vespalib::stringref &view, int32_t id, Weight weight) { +createLocationTerm(const Location &loc, vespalib::stringref view, int32_t id, Weight weight) { return new typename NodeTypes::LocationTerm(loc, view, id, weight); } template <class NodeTypes> typename NodeTypes::PredicateQuery * -createPredicateQuery(PredicateQueryTerm::UP term, const vespalib::stringref &view, int32_t id, Weight weight) { +createPredicateQuery(PredicateQueryTerm::UP term, vespalib::stringref view, int32_t id, Weight weight) { return new typename NodeTypes::PredicateQuery(std::move(term), view, id, weight); } template <class NodeTypes> typename NodeTypes::RegExpTerm * -createRegExpTerm(vespalib::stringref term, const vespalib::stringref &view, int32_t id, Weight weight) { +createRegExpTerm(vespalib::stringref term, vespalib::stringref view, int32_t id, Weight weight) { return new typename NodeTypes::RegExpTerm(term, view, id, weight); } @@ -233,33 +233,33 @@ public: typename NodeTypes::Or &addOr(int child_count) { return addIntermediate(createOr<NodeTypes>(), child_count); } - typename NodeTypes::WeakAnd &addWeakAnd(int child_count, uint32_t minHits, const stringref & view) { + typename NodeTypes::WeakAnd &addWeakAnd(int child_count, uint32_t minHits, stringref view) { return addIntermediate(createWeakAnd<NodeTypes>(minHits, view), child_count); } typename NodeTypes::Equiv &addEquiv(int child_count, int32_t id, Weight weight) { return addIntermediate(createEquiv<NodeTypes>(id, weight), child_count); } - typename NodeTypes::Phrase &addPhrase(int child_count, const stringref &view, int32_t id, Weight weight) { + typename NodeTypes::Phrase &addPhrase(int child_count, stringref view, int32_t id, Weight weight) { adjustWeight(weight); typename NodeTypes::Phrase &node = addIntermediate(createPhrase<NodeTypes>(view, id, weight), child_count); setWeightOverride(weight); return node; } - typename NodeTypes::SameElement &addSameElement(int child_count, const stringref &view) { + typename NodeTypes::SameElement &addSameElement(int child_count, stringref view) { return addIntermediate(createSameElement<NodeTypes>(view), child_count); } - typename NodeTypes::WeightedSetTerm &addWeightedSetTerm( int child_count, const stringref &view, int32_t id, Weight weight) { + typename NodeTypes::WeightedSetTerm &addWeightedSetTerm( int child_count, stringref view, int32_t id, Weight weight) { adjustWeight(weight); typename NodeTypes::WeightedSetTerm &node = addIntermediate(createWeightedSetTerm<NodeTypes>(view, id, weight), child_count); return node; } - typename NodeTypes::DotProduct &addDotProduct( int child_count, const stringref &view, int32_t id, Weight weight) { + typename NodeTypes::DotProduct &addDotProduct( int child_count, stringref view, int32_t id, Weight weight) { adjustWeight(weight); typename NodeTypes::DotProduct &node = addIntermediate( createDotProduct<NodeTypes>(view, id, weight), child_count); return node; } typename NodeTypes::WandTerm &addWandTerm( - int child_count, const stringref &view, + int child_count, stringref view, int32_t id, Weight weight, uint32_t targetNumHits, int64_t scoreThreshold, double thresholdBoostFactor) { @@ -273,39 +273,39 @@ public: return addIntermediate(createRank<NodeTypes>(), child_count); } - typename NodeTypes::NumberTerm &addNumberTerm(const stringref &term, const stringref &view, int32_t id, Weight weight) { + typename NodeTypes::NumberTerm &addNumberTerm(stringref term, stringref view, int32_t id, Weight weight) { adjustWeight(weight); return addTerm(createNumberTerm<NodeTypes>(term, view, id, weight)); } - typename NodeTypes::PrefixTerm &addPrefixTerm(const stringref &term, const stringref &view, int32_t id, Weight weight) { + typename NodeTypes::PrefixTerm &addPrefixTerm(stringref term, stringref view, int32_t id, Weight weight) { adjustWeight(weight); return addTerm(createPrefixTerm<NodeTypes>(term, view, id, weight)); } - typename NodeTypes::RangeTerm &addRangeTerm(const Range &range, const stringref &view, int32_t id, Weight weight) { + typename NodeTypes::RangeTerm &addRangeTerm(const Range &range, stringref view, int32_t id, Weight weight) { adjustWeight(weight); return addTerm(createRangeTerm<NodeTypes>(range, view, id, weight)); } - typename NodeTypes::StringTerm &addStringTerm(const stringref &term, const stringref &view, int32_t id, Weight weight) { + typename NodeTypes::StringTerm &addStringTerm(stringref term, stringref view, int32_t id, Weight weight) { adjustWeight(weight); return addTerm(createStringTerm<NodeTypes>(term, view, id, weight)); } - typename NodeTypes::SubstringTerm &addSubstringTerm(const stringref &t, const stringref &view, int32_t id, Weight weight) { + typename NodeTypes::SubstringTerm &addSubstringTerm(stringref t, stringref view, int32_t id, Weight weight) { adjustWeight(weight); return addTerm(createSubstringTerm<NodeTypes>(t, view, id, weight)); } - typename NodeTypes::SuffixTerm &addSuffixTerm(const stringref &term, const stringref &view, int32_t id, Weight weight) { + typename NodeTypes::SuffixTerm &addSuffixTerm(stringref term, stringref view, int32_t id, Weight weight) { adjustWeight(weight); return addTerm(createSuffixTerm<NodeTypes>(term, view, id, weight)); } - typename NodeTypes::LocationTerm &addLocationTerm(const Location &loc, const stringref &view, int32_t id, Weight weight) { + typename NodeTypes::LocationTerm &addLocationTerm(const Location &loc, stringref view, int32_t id, Weight weight) { adjustWeight(weight); return addTerm(createLocationTerm<NodeTypes>(loc, view, id, weight)); } - typename NodeTypes::PredicateQuery &addPredicateQuery(PredicateQueryTerm::UP term, const stringref &view, int32_t id, Weight weight) { + typename NodeTypes::PredicateQuery &addPredicateQuery(PredicateQueryTerm::UP term, stringref view, int32_t id, Weight weight) { adjustWeight(weight); return addTerm(createPredicateQuery<NodeTypes>(std::move(term), view, id, weight)); } - typename NodeTypes::RegExpTerm &addRegExpTerm(const stringref &term, const stringref &view, int32_t id, Weight weight) { + typename NodeTypes::RegExpTerm &addRegExpTerm(stringref term, stringref view, int32_t id, Weight weight) { adjustWeight(weight); return addTerm(createRegExpTerm<NodeTypes>(term, view, id, weight)); } diff --git a/searchlib/src/vespa/searchlib/query/tree/simplequery.h b/searchlib/src/vespa/searchlib/query/tree/simplequery.h index 3a2cc2f719e..707ed2aa0db 100644 --- a/searchlib/src/vespa/searchlib/query/tree/simplequery.h +++ b/searchlib/src/vespa/searchlib/query/tree/simplequery.h @@ -18,7 +18,7 @@ struct SimpleNear : Near { SimpleNear(size_t dist) : Near(dist) {} }; struct SimpleONear : ONear { SimpleONear(size_t dist) : ONear(dist) {} }; struct SimpleOr : Or {}; struct SimpleWeakAnd : WeakAnd { - SimpleWeakAnd(uint32_t minHits, const vespalib::stringref & view) : + SimpleWeakAnd(uint32_t minHits, vespalib::stringref view) : WeakAnd(minHits, view) {} }; @@ -49,56 +49,56 @@ struct SimpleWandTerm : WandTerm { }; struct SimpleRank : Rank {}; struct SimpleNumberTerm : NumberTerm { - SimpleNumberTerm(Type term, const vespalib::stringref &view, + SimpleNumberTerm(Type term, vespalib::stringref view, int32_t id, Weight weight) : NumberTerm(term, view, id, weight) { } }; struct SimpleLocationTerm : LocationTerm { - SimpleLocationTerm(const Type &term, const vespalib::stringref &view, + SimpleLocationTerm(const Type &term, vespalib::stringref view, int32_t id, Weight weight) : LocationTerm(term, view, id, weight) { } }; struct SimplePrefixTerm : PrefixTerm { - SimplePrefixTerm(const Type &term, const vespalib::stringref &view, + SimplePrefixTerm(const Type &term, vespalib::stringref view, int32_t id, Weight weight) : PrefixTerm(term, view, id, weight) { } }; struct SimpleRangeTerm : RangeTerm { - SimpleRangeTerm(const Type &term, const vespalib::stringref &view, + SimpleRangeTerm(const Type &term, vespalib::stringref view, int32_t id, Weight weight) : RangeTerm(term, view, id, weight) { } }; struct SimpleStringTerm : StringTerm { - SimpleStringTerm(const Type &term, const vespalib::stringref &view, + SimpleStringTerm(const Type &term, vespalib::stringref view, int32_t id, Weight weight) : StringTerm(term, view, id, weight) { } }; struct SimpleSubstringTerm : SubstringTerm { - SimpleSubstringTerm(const Type &term, const vespalib::stringref &view, + SimpleSubstringTerm(const Type &term, vespalib::stringref view, int32_t id, Weight weight) : SubstringTerm(term, view, id, weight) { } }; struct SimpleSuffixTerm : SuffixTerm { - SimpleSuffixTerm(const Type &term, const vespalib::stringref &view, + SimpleSuffixTerm(const Type &term, vespalib::stringref view, int32_t id, Weight weight) : SuffixTerm(term, view, id, weight) { } }; struct SimplePredicateQuery : PredicateQuery { SimplePredicateQuery(PredicateQueryTerm::UP term, - const vespalib::stringref &view, + vespalib::stringref view, int32_t id, Weight weight) : PredicateQuery(std::move(term), view, id, weight) { } }; struct SimpleRegExpTerm : RegExpTerm { - SimpleRegExpTerm(const Type &term, const vespalib::stringref &view, + SimpleRegExpTerm(const Type &term, vespalib::stringref view, int32_t id, Weight weight) : RegExpTerm(term, view, id, weight) { } diff --git a/searchlib/src/vespa/searchlib/query/tree/termnodes.h b/searchlib/src/vespa/searchlib/query/tree/termnodes.h index 9ea2c54f1a0..35c23dde985 100644 --- a/searchlib/src/vespa/searchlib/query/tree/termnodes.h +++ b/searchlib/src/vespa/searchlib/query/tree/termnodes.h @@ -15,7 +15,7 @@ typedef TermBase<vespalib::string> StringBase; class NumberTerm : public QueryNodeMixin<NumberTerm, StringBase > { public: - NumberTerm(Type term, const vespalib::stringref &view, int32_t id, Weight weight) + NumberTerm(Type term, vespalib::stringref view, int32_t id, Weight weight) : QueryNodeMixinType(term, view, id, weight) {} virtual ~NumberTerm() = 0; }; @@ -25,7 +25,7 @@ public: class PrefixTerm : public QueryNodeMixin<PrefixTerm, StringBase > { public: - PrefixTerm(const Type &term, const vespalib::stringref &view, + PrefixTerm(const Type &term, vespalib::stringref view, int32_t id, Weight weight) : QueryNodeMixinType(term, view, id, weight) {} @@ -37,7 +37,7 @@ public: class RangeTerm : public QueryNodeMixin<RangeTerm, TermBase<Range> > { public: - RangeTerm(const Type& term, const vespalib::stringref &view, + RangeTerm(const Type& term, vespalib::stringref view, int32_t id, Weight weight) : QueryNodeMixinType(term, view, id, weight) {} @@ -58,7 +58,7 @@ public: class SubstringTerm : public QueryNodeMixin<SubstringTerm, StringBase > { public: - SubstringTerm(const Type &term, const vespalib::stringref &view, + SubstringTerm(const Type &term, vespalib::stringref view, int32_t id, Weight weight) : QueryNodeMixinType(term, view, id, weight) {} @@ -70,7 +70,7 @@ class SubstringTerm : public QueryNodeMixin<SubstringTerm, StringBase > class SuffixTerm : public QueryNodeMixin<SuffixTerm, StringBase > { public: - SuffixTerm(const Type &term, const vespalib::stringref &view, + SuffixTerm(const Type &term, vespalib::stringref view, int32_t id, Weight weight) : QueryNodeMixinType(term, view, id, weight) {} @@ -82,7 +82,7 @@ public: class LocationTerm : public QueryNodeMixin<LocationTerm, TermBase<Location> > { public: - LocationTerm(const Type &term, const vespalib::stringref &view, + LocationTerm(const Type &term, vespalib::stringref view, int32_t id, Weight weight) : QueryNodeMixinType(term, view, id, weight) {} @@ -95,7 +95,7 @@ class PredicateQuery : public QueryNodeMixin<PredicateQuery, TermBase<PredicateQueryTerm::UP> > { public: - PredicateQuery(PredicateQueryTerm::UP term, const vespalib::stringref &view, + PredicateQuery(PredicateQueryTerm::UP term, vespalib::stringref view, int32_t id, Weight weight) : QueryNodeMixinType(std::move(term), view, id, weight) {} @@ -106,7 +106,7 @@ public: class RegExpTerm : public QueryNodeMixin<RegExpTerm, StringBase> { public: - RegExpTerm(const Type &term, const vespalib::stringref &view, + RegExpTerm(const Type &term, vespalib::stringref view, int32_t id, Weight weight) : QueryNodeMixinType(term, view, id, weight) {} |