diff options
83 files changed, 192 insertions, 205 deletions
diff --git a/searchlib/src/tests/diskindex/bitvector/bitvector_test.cpp b/searchlib/src/tests/diskindex/bitvector/bitvector_test.cpp index dc352f70706..e33158e559f 100644 --- a/searchlib/src/tests/diskindex/bitvector/bitvector_test.cpp +++ b/searchlib/src/tests/diskindex/bitvector/bitvector_test.cpp @@ -20,7 +20,7 @@ struct FieldWriterWrapper FieldWriterWrapper(uint32_t docIdLimit, uint64_t numWordIds); FieldWriterWrapper & - newWord(const vespalib::stringref &word); + newWord(vespalib::stringref word); FieldWriterWrapper & add(uint32_t docId); @@ -51,7 +51,7 @@ FieldWriterWrapper::open(const std::string &path, } FieldWriterWrapper & -FieldWriterWrapper::newWord(const vespalib::stringref &word) +FieldWriterWrapper::newWord(vespalib::stringref word) { _writer.newWord(word); return *this; diff --git a/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp b/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp index c926d1c2831..0990f21f820 100644 --- a/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp +++ b/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp @@ -69,7 +69,7 @@ public: {} virtual void - startWord(const vespalib::stringref &word) override + startWord(vespalib::stringref word) override { assert(_insideField); assert(!_insideWord); @@ -452,7 +452,7 @@ public: { } - WrapInserter &word(const vespalib::stringref &word_) + WrapInserter &word(vespalib::stringref word_) { _inserter.setNextWord(word_); return *this; diff --git a/searchlib/src/tests/memoryindex/document_remover/document_remover_test.cpp b/searchlib/src/tests/memoryindex/document_remover/document_remover_test.cpp index 6f09dd5c924..af7a9422e49 100644 --- a/searchlib/src/tests/memoryindex/document_remover/document_remover_test.cpp +++ b/searchlib/src/tests/memoryindex/document_remover/document_remover_test.cpp @@ -18,7 +18,7 @@ struct WordFieldPair { vespalib::string _word; uint32_t _fieldId; - WordFieldPair(const vespalib::stringref &word, uint32_t fieldId) + WordFieldPair(vespalib::stringref word, uint32_t fieldId) : _word(word), _fieldId(fieldId) {} bool operator<(const WordFieldPair &rhs) { diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp index e2dc9f4c856..9fd70ddea77 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp @@ -58,7 +58,7 @@ namespace search { IMPLEMENT_IDENTIFIABLE_ABSTRACT(AttributeVector, vespalib::Identifiable); -AttributeVector::BaseName::BaseName(const vespalib::stringref &base, +AttributeVector::BaseName::BaseName(vespalib::stringref base, const vespalib::stringref &snap, const vespalib::stringref &name) : string(base), @@ -118,7 +118,7 @@ AttributeVector::BaseName::getSnapshotName() const AttributeVector::BaseName::string -AttributeVector::BaseName::createAttributeName(const vespalib::stringref & s) +AttributeVector::BaseName::createAttributeName(vespalib::stringref s) { size_t p(s.rfind('/')); if (p == string::npos) { @@ -158,7 +158,7 @@ AttributeVector::ValueModifier::~ValueModifier() { } -AttributeVector::AttributeVector(const vespalib::stringref &baseFileName, const Config &c) +AttributeVector::AttributeVector(vespalib::stringref baseFileName, const Config &c) : _baseFileName(baseFileName), _config(c), _interlock(std::make_shared<attribute::Interlock>()), @@ -383,14 +383,14 @@ AttributeVector::loadFile(const char *suffix) bool -AttributeVector::saveAs(const vespalib::stringref &baseFileName) +AttributeVector::saveAs(vespalib::stringref baseFileName) { _baseFileName = baseFileName; return save(); } bool -AttributeVector::saveAs(const vespalib::stringref &baseFileName, +AttributeVector::saveAs(vespalib::stringref baseFileName, IAttributeSaveTarget & saveTarget) { _baseFileName = baseFileName; diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h index bcd4b1ae079..72a595319a1 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.h +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h @@ -127,17 +127,17 @@ public: { public: typedef vespalib::string string; - BaseName(const vespalib::stringref &s) + BaseName(vespalib::stringref s) : string(s), _name(createAttributeName(s)) { } - BaseName & operator = (const vespalib::stringref & s) { + BaseName & operator = (vespalib::stringref s) { BaseName n(s); std::swap(*this, n); return *this; } - BaseName(const vespalib::stringref &base, + BaseName(vespalib::stringref base, const vespalib::stringref &snap, const vespalib::stringref &name); ~BaseName(); @@ -147,7 +147,7 @@ public: const string & getAttributeName() const { return _name; } string getDirName() const; private: - static string createAttributeName(const vespalib::stringref & s); + static string createAttributeName(vespalib::stringref s); string _name; }; @@ -205,7 +205,7 @@ protected: } - AttributeVector(const vespalib::stringref &baseFileName, const Config & c); + AttributeVector(vespalib::stringref baseFileName, const Config & c); void checkSetMaxValueCount(int index) { _highestValueCount = std::max(index, _highestValueCount); @@ -403,7 +403,7 @@ public: BasicType getInternalBasicType() const { return _config.basicType(); } CollectionType getInternalCollectionType() const { return _config.collectionType(); } const BaseName & getBaseFileName() const { return _baseFileName; } - void setBaseFileName(const vespalib::stringref & name) { _baseFileName = name; } + void setBaseFileName(vespalib::stringref name) { _baseFileName = name; } // Implements IAttributeVector const vespalib::string & getName() const override final { return _baseFileName.getAttributeName(); } @@ -437,13 +437,13 @@ public: * Updates the base file name of this attribute vector and saves * it to file(s) */ - bool saveAs(const vespalib::stringref &baseFileName); + bool saveAs(vespalib::stringref baseFileName); /** * Updates the base file name of this attribute vector and saves * it using the given saveTarget */ - bool saveAs(const vespalib::stringref &baseFileName, IAttributeSaveTarget &saveTarget); + bool saveAs(vespalib::stringref baseFileName, IAttributeSaveTarget &saveTarget); /** Saves this attribute vector to file(s) **/ bool save(); diff --git a/searchlib/src/vespa/searchlib/bitcompression/compression.cpp b/searchlib/src/vespa/searchlib/bitcompression/compression.cpp index b56f4760ec7..1031aab71f5 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/compression.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/compression.cpp @@ -267,7 +267,7 @@ writeBits(const uint64_t *bits, uint32_t bitOffset, uint32_t bitLength) template <bool bigEndian> void FeatureEncodeContext<bigEndian>:: -writeString(const vespalib::stringref &buf) +writeString(vespalib::stringref buf) { size_t len = buf.size(); for (unsigned int i = 0; i < len; ++i) { diff --git a/searchlib/src/vespa/searchlib/bitcompression/compression.h b/searchlib/src/vespa/searchlib/bitcompression/compression.h index 954afc60a1a..931e4165b21 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/compression.h +++ b/searchlib/src/vespa/searchlib/bitcompression/compression.h @@ -1672,7 +1672,7 @@ public: writeBits(const uint64_t *bits, uint32_t bitOffset, uint32_t bitLength); void - writeString(const vespalib::stringref &buf); + writeString(vespalib::stringref buf); virtual void writeHeader(const vespalib::GenericHeader &header); diff --git a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp index 23fcfb0b719..5d1fec2f65d 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp @@ -101,7 +101,7 @@ typedef PageDict4StartOffset StartOffset; #define K_VALUE_COUNTFILE_L6_ACCNUMDOCS 16 static uint32_t -getLCP(const vespalib::stringref &word, +getLCP(vespalib::stringref word, const vespalib::stringref &prevWord) { size_t len1 = word.size(); @@ -118,7 +118,7 @@ getLCP(const vespalib::stringref &word, static void -addLCPWord(const vespalib::stringref &word, size_t lcp, std::vector<char> &v) +addLCPWord(vespalib::stringref word, size_t lcp, std::vector<char> &v) { v.push_back(lcp); size_t pos = lcp; @@ -189,7 +189,7 @@ PageDict4SSWriter::~PageDict4SSWriter() } void -PageDict4SSWriter::addL6Skip(const vespalib::stringref &word, +PageDict4SSWriter::addL6Skip(vespalib::stringref word, const StartOffset &startOffset, uint64_t wordNum, uint64_t pageNum, @@ -226,7 +226,7 @@ PageDict4SSWriter::addL6Skip(const vespalib::stringref &word, void PageDict4SSWriter:: -addOverflowCounts(const vespalib::stringref &word, +addOverflowCounts(vespalib::stringref word, const Counts &counts, const StartOffset &startOffset, uint64_t wordNum) @@ -454,7 +454,7 @@ PageDict4SPWriter::resetPage() void -PageDict4SPWriter::addL3Skip(const vespalib::stringref &word, +PageDict4SPWriter::addL3Skip(vespalib::stringref word, const StartOffset &startOffset, uint64_t wordNum, uint64_t pageNum) @@ -771,7 +771,7 @@ PageDict4PWriter::resetPage() void PageDict4PWriter:: -addCounts(const vespalib::stringref &word, +addCounts(vespalib::stringref word, const Counts &counts) { assert(_countsWordOffset == _words.size()); @@ -825,7 +825,7 @@ addCounts(const vespalib::stringref &word, /* Private use */ void -PageDict4PWriter::addOverflowCounts(const vespalib::stringref &word, +PageDict4PWriter::addOverflowCounts(vespalib::stringref word, const Counts &counts) { assert(_countsEntries == 0); @@ -1082,7 +1082,7 @@ PageDict4SSReader::setup(DC &ssd) PageDict4SSLookupRes PageDict4SSReader:: -lookup(const vespalib::stringref &key) +lookup(vespalib::stringref key) { PageDict4SSLookupRes res; diff --git a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h index 717702d4ef7..1669d45e33a 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h +++ b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h @@ -141,7 +141,7 @@ public: * startOffset represents file position / accNumDocs after word. */ void - addL6Skip(const vespalib::stringref &word, + addL6Skip(vespalib::stringref word, const StartOffset &startOffset, uint64_t wordNum, uint64_t pageNum, @@ -153,7 +153,7 @@ public: * startOffset represents file position / accNumDocs at start of entry. */ void - addOverflowCounts(const vespalib::stringref &word, + addOverflowCounts(vespalib::stringref word, const Counts &counts, const StartOffset &startOffset, uint64_t wordNum); @@ -263,7 +263,7 @@ public: resetPage(); void - addL3Skip(const vespalib::stringref &word, + addL3Skip(vespalib::stringref word, const StartOffset &startOffset, uint64_t wordNum, uint64_t pageNum); @@ -293,7 +293,7 @@ public: * startOffset represents file position / accNumDocs at start of entry. */ void - addOverflowCounts(const vespalib::stringref &word, + addOverflowCounts(vespalib::stringref word, const Counts &counts, const StartOffset &startOffset, uint64_t wordNum) @@ -386,7 +386,7 @@ private: EC &_pe; void - addOverflowCounts(const vespalib::stringref &word, + addOverflowCounts(vespalib::stringref word, const Counts &counts); public: @@ -408,7 +408,7 @@ public: resetPage(); void - addCounts(const vespalib::stringref &word, + addCounts(vespalib::stringref word, const Counts &counts); void @@ -493,7 +493,7 @@ public: { } - L7Entry(const vespalib::stringref &l7Word, + L7Entry(vespalib::stringref l7Word, const StartOffset &l7StartOffset, uint64_t l7WordNum, uint64_t l6Offset, @@ -511,7 +511,7 @@ public: } bool - operator<(const vespalib::stringref &word) const + operator<(vespalib::stringref word) const { return _l7Word < word; } @@ -576,7 +576,7 @@ public: setup(DC &ssd); PageDict4SSLookupRes - lookup(const vespalib::stringref &key); + lookup(vespalib::stringref key); PageDict4SSLookupRes lookupOverflow(uint64_t wordNum) const; diff --git a/searchlib/src/vespa/searchlib/common/packets.h b/searchlib/src/vespa/searchlib/common/packets.h index 87e2bd998b1..0a98bf87de8 100644 --- a/searchlib/src/vespa/searchlib/common/packets.h +++ b/searchlib/src/vespa/searchlib/common/packets.h @@ -174,7 +174,7 @@ public: ~FS4Properties(); void allocEntries(uint32_t cnt); void setName(const char *name, uint32_t nameSize) { _name.assign(name, nameSize); } - void setName(const vespalib::stringref &val) { + void setName(vespalib::stringref val) { setName(val.data(), val.size()); } void setKey(uint32_t entry, const char *key, uint32_t keySize); @@ -282,7 +282,7 @@ public: uint32_t _errorCode; string _message; - void setErrorMessage(const vespalib::stringref &msg) { _message = msg; } + void setErrorMessage(vespalib::stringref msg) { _message = msg; } FS4Packet_ERROR(); ~FS4Packet_ERROR(); @@ -464,12 +464,12 @@ public: string _stackDump; // if QF_PARSEDQUERY void setQueryFlags(uint32_t qflags) { _qflags = ACTIVE_QUERY_FLAGS & qflags; } - void setRanking(const vespalib::stringref &ranking) { _ranking = ranking; } - void setSortSpec(const vespalib::stringref &spec) { _sortSpec = spec; } - void setGroupSpec(const vespalib::stringref &spec) { _groupSpec = spec; } - void setSessionId(const vespalib::stringref &sid) { _sessionId = sid; } - void setLocation(const vespalib::stringref &loc) { _location = loc; } - void setStackDump(const vespalib::stringref &buf) { _stackDump = buf; } + void setRanking(vespalib::stringref ranking) { _ranking = ranking; } + void setSortSpec(vespalib::stringref spec) { _sortSpec = spec; } + void setGroupSpec(vespalib::stringref spec) { _groupSpec = spec; } + void setSessionId(vespalib::stringref sid) { _sessionId = sid; } + void setLocation(vespalib::stringref loc) { _location = loc; } + void setStackDump(vespalib::stringref buf) { _stackDump = buf; } void setTimeout(const fastos::TimeStamp & timeout); fastos::TimeStamp getTimeout() const; uint32_t getQueryFlags() const { return _qflags; } @@ -512,10 +512,10 @@ public: void AllocateDocIDs(uint32_t cnt); - void setResultClassName(const vespalib::stringref &name) { _resultClassName = name; } - void setStackDump(const vespalib::stringref &buf) { _stackDump = buf; } - void setRanking(const vespalib::stringref &ranking) { _ranking = ranking; } - void setLocation(const vespalib::stringref &loc) { _location = loc; } + void setResultClassName(vespalib::stringref name) { _resultClassName = name; } + void setStackDump(vespalib::stringref buf) { _stackDump = buf; } + void setRanking(vespalib::stringref ranking) { _ranking = ranking; } + void setLocation(vespalib::stringref loc) { _location = loc; } void setTimeout(const fastos::TimeStamp & timeout); fastos::TimeStamp getTimeout() const; diff --git a/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.h b/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.h index 9436c17cdbc..ce791314b36 100644 --- a/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.h +++ b/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.h @@ -29,7 +29,7 @@ public: } void - tryWriteWord(const vespalib::stringref &word) + tryWriteWord(vespalib::stringref word) { if (word != _word || _wordNum == 0) { ++_wordNum; diff --git a/searchlib/src/vespa/searchlib/diskindex/fieldwriter.cpp b/searchlib/src/vespa/searchlib/diskindex/fieldwriter.cpp index 6b66568ef7a..d62b69c5bf5 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fieldwriter.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/fieldwriter.cpp @@ -135,7 +135,7 @@ FieldWriter::newWord(uint64_t wordNum, const vespalib::stringref &word) void -FieldWriter::newWord(const vespalib::stringref &word) +FieldWriter::newWord(vespalib::stringref word) { newWord(_wordNum + 1, word); } diff --git a/searchlib/src/vespa/searchlib/diskindex/fieldwriter.h b/searchlib/src/vespa/searchlib/diskindex/fieldwriter.h index 8f879360ea5..f0dc033b01e 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fieldwriter.h +++ b/searchlib/src/vespa/searchlib/diskindex/fieldwriter.h @@ -59,7 +59,7 @@ public: ~FieldWriter(); void newWord(uint64_t wordNum, const vespalib::stringref &word); - void newWord(const vespalib::stringref &word); + void newWord(vespalib::stringref word); void add(const DocIdAndFeatures &features) { assert(features._docId < _docIdLimit); diff --git a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp index b744a68932d..f14d158d616 100644 --- a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp @@ -46,7 +46,7 @@ public: ~FileHandle(); void - open(const vespalib::stringref &dir, + open(vespalib::stringref dir, const SchemaUtil::IndexIterator &index, uint32_t docIdLimit, uint64_t numWordIds, const TuneFileSeqWrite &tuneFileWrite, @@ -172,7 +172,7 @@ public: FileHandle _files; void - startWord(const vespalib::stringref &word); + startWord(vespalib::stringref word); void endWord(); @@ -282,7 +282,7 @@ FileHandle::~FileHandle() void -FileHandle::open(const vespalib::stringref &dir, +FileHandle::open(vespalib::stringref dir, const SchemaUtil::IndexIterator &index, uint32_t docIdLimit, uint64_t numWordIds, const TuneFileSeqWrite &tuneFileWrite, @@ -346,7 +346,7 @@ IndexBuilder::FieldHandle::~FieldHandle() void -IndexBuilder::FieldHandle::startWord(const vespalib::stringref &word) +IndexBuilder::FieldHandle::startWord(vespalib::stringref word) { assert(_valid); _files._fieldWriter->newWord(word); @@ -553,7 +553,7 @@ IndexBuilder::~IndexBuilder() void -IndexBuilder::startWord(const vespalib::stringref &word) +IndexBuilder::startWord(vespalib::stringref word) { assert(_currentField != nullptr); assert(!_inWord); @@ -649,14 +649,14 @@ IndexBuilder::addOcc(const WordDocElementWordPosFeatures &features) void -IndexBuilder::setPrefix(const vespalib::stringref &prefix) +IndexBuilder::setPrefix(vespalib::stringref prefix) { _prefix = prefix; } vespalib::string -IndexBuilder::appendToPrefix(const vespalib::stringref &name) +IndexBuilder::appendToPrefix(vespalib::stringref name) { if (_prefix.empty()) return name; diff --git a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.h b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.h index 50cb17242da..dd5baf7c699 100644 --- a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.h +++ b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.h @@ -51,7 +51,7 @@ public: IndexBuilder(const Schema &schema); virtual ~IndexBuilder(); - virtual void startWord(const vespalib::stringref &word) override; + virtual void startWord(vespalib::stringref word) override; virtual void endWord() override; virtual void startDocument(uint32_t docId) override; virtual void endDocument() override; @@ -65,9 +65,9 @@ public: // TODO: methods for document summary. inline FieldHandle & getIndexFieldHandle(uint32_t fieldId); - void setPrefix(const vespalib::stringref &prefix); + void setPrefix(vespalib::stringref prefix); - vespalib::string appendToPrefix(const vespalib::stringref &name); + vespalib::string appendToPrefix(vespalib::stringref name); void open(uint32_t docIdLimit, uint64_t numWordIds, diff --git a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp index 791e41de497..1870de30bad 100644 --- a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp @@ -321,7 +321,7 @@ PageDict4FileSeqWrite::~PageDict4FileSeqWrite() void -PageDict4FileSeqWrite::writeWord(const vespalib::stringref &word, +PageDict4FileSeqWrite::writeWord(vespalib::stringref word, const PostingListCounts &counts) { _pWriter->addCounts(word, counts); diff --git a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.h b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.h index 7baa883a740..e176ba26d88 100644 --- a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.h +++ b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.h @@ -159,7 +159,7 @@ public: * Write word and counts. Only nonzero counts should be supplied. */ virtual void - writeWord(const vespalib::stringref &word, + writeWord(vespalib::stringref word, const PostingListCounts &counts) override; /** diff --git a/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.cpp b/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.cpp index e610f7a9179..67f955fab07 100644 --- a/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.cpp @@ -146,7 +146,7 @@ PageDict4RandRead::readPHeader() bool -PageDict4RandRead::lookup(const vespalib::stringref &word, +PageDict4RandRead::lookup(vespalib::stringref word, uint64_t &wordNum, PostingListOffsetAndCounts &offsetAndCounts) { diff --git a/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.h b/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.h index abe0bf86543..b7159f9398e 100644 --- a/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.h +++ b/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.h @@ -46,7 +46,7 @@ public: PageDict4RandRead(); ~PageDict4RandRead(); - bool lookup(const vespalib::stringref &word, uint64_t &wordNum, + bool lookup(vespalib::stringref word, uint64_t &wordNum, PostingListOffsetAndCounts &offsetAndCounts) override; bool open(const vespalib::string &name, const TuneFileRandRead &tuneFileRead) override; diff --git a/searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp b/searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp index 2cfa023e7ed..0c8ae805c46 100644 --- a/searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp +++ b/searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp @@ -8,7 +8,7 @@ using vespalib::make_string; namespace search { -SummaryException::SummaryException(const vespalib::stringref &msg, +SummaryException::SummaryException(vespalib::stringref msg, FastOS_FileInterface &file, const vespalib::stringref &location) : IoException(make_string("%s : Failing file = '%s'. Reason given by OS = '%s'", diff --git a/searchlib/src/vespa/searchlib/docstore/summaryexceptions.h b/searchlib/src/vespa/searchlib/docstore/summaryexceptions.h index a04639711fe..58e441f0a08 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(const vespalib::stringref &msg, FastOS_FileInterface & file, const vespalib::stringref &location); + SummaryException(vespalib::stringref msg, FastOS_FileInterface & file, const vespalib::stringref &location); }; } // namespace search diff --git a/searchlib/src/vespa/searchlib/engine/propertiesmap.cpp b/searchlib/src/vespa/searchlib/engine/propertiesmap.cpp index f9045612849..b09813c0258 100644 --- a/searchlib/src/vespa/searchlib/engine/propertiesmap.cpp +++ b/searchlib/src/vespa/searchlib/engine/propertiesmap.cpp @@ -14,13 +14,13 @@ PropertiesMap::PropertiesMap() PropertiesMap::~PropertiesMap() { } fef::Properties & -PropertiesMap::lookupCreate(const vespalib::stringref &name) +PropertiesMap::lookupCreate(vespalib::stringref name) { return _propertiesMap[name]; } const fef::Properties & -PropertiesMap::lookup(const vespalib::stringref &name) const +PropertiesMap::lookup(vespalib::stringref name) const { PropsMap::const_iterator pos = _propertiesMap.find(name); if (pos == _propertiesMap.end()) { diff --git a/searchlib/src/vespa/searchlib/engine/propertiesmap.h b/searchlib/src/vespa/searchlib/engine/propertiesmap.h index d4d4598add2..ba80e4a2f05 100644 --- a/searchlib/src/vespa/searchlib/engine/propertiesmap.h +++ b/searchlib/src/vespa/searchlib/engine/propertiesmap.h @@ -28,7 +28,7 @@ private: * @param name name of properties * @return the properties **/ - const Props &lookup(const vespalib::stringref &name) const; + const Props &lookup(vespalib::stringref name) const; public: typedef PropsMap::const_iterator ITR; @@ -43,7 +43,7 @@ public: * @param name name of properties * @return the properties **/ - Props &lookupCreate(const vespalib::stringref &name); + Props &lookupCreate(vespalib::stringref name); /** * Obtain the number of named collection of properties held by diff --git a/searchlib/src/vespa/searchlib/engine/transportserver.cpp b/searchlib/src/vespa/searchlib/engine/transportserver.cpp index c94e36202a1..c5e59024c31 100644 --- a/searchlib/src/vespa/searchlib/engine/transportserver.cpp +++ b/searchlib/src/vespa/searchlib/engine/transportserver.cpp @@ -305,7 +305,7 @@ TransportServer::discardRequests() } void -TransportServer::logPacket(const vespalib::stringref &msg, FNET_Packet *p, FNET_Channel *ch, FNET_Connection *conn) +TransportServer::logPacket(vespalib::stringref msg, FNET_Packet *p, FNET_Channel *ch, FNET_Connection *conn) { uint32_t chid = -1; uint32_t conntag = -1; diff --git a/searchlib/src/vespa/searchlib/engine/transportserver.h b/searchlib/src/vespa/searchlib/engine/transportserver.h index 76327dd8fcd..691f6fbe791 100644 --- a/searchlib/src/vespa/searchlib/engine/transportserver.h +++ b/searchlib/src/vespa/searchlib/engine/transportserver.h @@ -169,7 +169,7 @@ private: void discardRequests(); // convenience method used to log packets - static void logPacket(const vespalib::stringref &msg, FNET_Packet *p, FNET_Channel *ch, FNET_Connection *conn); + static void logPacket(vespalib::stringref msg, FNET_Packet *p, FNET_Channel *ch, FNET_Connection *conn); void updateQueryMetrics(double latency_s); void updateDocsumMetrics(double latency_s, uint32_t numDocs); diff --git a/searchlib/src/vespa/searchlib/expression/attributenode.cpp b/searchlib/src/vespa/searchlib/expression/attributenode.cpp index 4984aceea71..41955c08261 100644 --- a/searchlib/src/vespa/searchlib/expression/attributenode.cpp +++ b/searchlib/src/vespa/searchlib/expression/attributenode.cpp @@ -55,7 +55,7 @@ AttributeNode::AttributeNode() : AttributeNode::~AttributeNode() {} -AttributeNode::AttributeNode(const vespalib::stringref &name) : +AttributeNode::AttributeNode(vespalib::stringref name) : FunctionNode(), _scratchResult(new AttributeResult()), _hasMultiValue(false), diff --git a/searchlib/src/vespa/searchlib/expression/attributenode.h b/searchlib/src/vespa/searchlib/expression/attributenode.h index ca6fa368423..912b0f94c50 100644 --- a/searchlib/src/vespa/searchlib/expression/attributenode.h +++ b/searchlib/src/vespa/searchlib/expression/attributenode.h @@ -69,7 +69,7 @@ public: void visitMembers(vespalib::ObjectVisitor &visitor) const override; DECLARE_EXPRESSIONNODE(AttributeNode); AttributeNode(); - AttributeNode(const vespalib::stringref &name); + AttributeNode(vespalib::stringref name); AttributeNode(const search::attribute::IAttributeVector & attribute); AttributeNode(const AttributeNode & attribute); AttributeNode & operator = (const AttributeNode & attribute); diff --git a/searchlib/src/vespa/searchlib/expression/documentfieldnode.cpp b/searchlib/src/vespa/searchlib/expression/documentfieldnode.cpp index c7ce9528520..6ae90642383 100644 --- a/searchlib/src/vespa/searchlib/expression/documentfieldnode.cpp +++ b/searchlib/src/vespa/searchlib/expression/documentfieldnode.cpp @@ -49,7 +49,7 @@ DocumentFieldNode & DocumentFieldNode::operator = (const DocumentFieldNode & rhs } std::unique_ptr<ResultNode> -deduceResultNode(const vespalib::stringref & fieldName, const FieldValue & fv, bool preserveAccurateTypes, bool nestedMultiValue) +deduceResultNode(vespalib::stringref fieldName, const FieldValue & fv, bool preserveAccurateTypes, bool nestedMultiValue) { std::unique_ptr<ResultNode> value; const Identifiable::RuntimeClass & cInfo = fv.getClass(); diff --git a/searchlib/src/vespa/searchlib/expression/documentfieldnode.h b/searchlib/src/vespa/searchlib/expression/documentfieldnode.h index bd5ecf61e1c..beb658f7524 100644 --- a/searchlib/src/vespa/searchlib/expression/documentfieldnode.h +++ b/searchlib/src/vespa/searchlib/expression/documentfieldnode.h @@ -34,7 +34,7 @@ public: DECLARE_EXPRESSIONNODE(DocumentFieldNode); DocumentFieldNode() : _fieldPath(), _value(), _fieldName(), _doc(NULL) { } ~DocumentFieldNode(); - DocumentFieldNode(const vespalib::stringref &name) : _fieldPath(), _value(), _fieldName(name), _doc(NULL) { } + DocumentFieldNode(vespalib::stringref name) : _fieldPath(), _value(), _fieldName(name), _doc(NULL) { } DocumentFieldNode(const DocumentFieldNode & rhs); DocumentFieldNode & operator = (const DocumentFieldNode & rhs); const vespalib::string & getFieldName() const override { return _fieldName; } diff --git a/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.cpp b/searchlib/src/vespa/searchlib/expression/stringbucketresultnode.cpp index c55c35f205d..fb0a467abb2 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(const vespalib::stringref & from, const vespalib::stringref & to) +StringBucketResultNode::StringBucketResultNode(vespalib::stringref from, const 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 bef885c3c53..9c8417214c2 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(const vespalib::stringref & from, const vespalib::stringref & to); + StringBucketResultNode(vespalib::stringref from, const 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(const vespalib::stringref & from, const vespalib::stringref & to) { + StringBucketResultNode &setRange(vespalib::stringref from, const vespalib::stringref & to) { _from.reset(new StringResultNode(from)); _to.reset(new StringResultNode(to)); return *this; diff --git a/searchlib/src/vespa/searchlib/expression/stringresultnode.h b/searchlib/src/vespa/searchlib/expression/stringresultnode.h index 05e6b3321bb..a071467e76c 100644 --- a/searchlib/src/vespa/searchlib/expression/stringresultnode.h +++ b/searchlib/src/vespa/searchlib/expression/stringresultnode.h @@ -13,14 +13,14 @@ public: DECLARE_NBO_SERIALIZE; void visitMembers(vespalib::ObjectVisitor &visitor) const override; StringResultNode(const char * v="") : _value(v) { } - StringResultNode(const vespalib::stringref & v) : _value(v) { } + StringResultNode(vespalib::stringref v) : _value(v) { } size_t hash() const override; int onCmp(const Identifiable & b) const override; void set(const ResultNode & rhs) override; StringResultNode & append(const ResultNode & rhs); StringResultNode & clear() { _value.clear(); return *this; } const vespalib::string & get() const { return _value; } - void set(const vespalib::stringref & value) { _value = value; } + void set(vespalib::stringref value) { _value = value; } void min(const ResultNode & b) override; void max(const ResultNode & b) override; void add(const ResultNode & b) override; diff --git a/searchlib/src/vespa/searchlib/features/attributefeature.cpp b/searchlib/src/vespa/searchlib/features/attributefeature.cpp index 7e913f96b7f..e7f4ab0e352 100644 --- a/searchlib/src/vespa/searchlib/features/attributefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/attributefeature.cpp @@ -37,18 +37,18 @@ using namespace search::fef::indexproperties; namespace { template <typename X, typename Y> -bool equals(const X & lhs, const Y & rhs) { +bool equals(X lhs, Y rhs) { return lhs == rhs; } template <> -bool equals<ConstCharPtr, vespalib::stringref>(const ConstCharPtr & lhs, const vespalib::stringref & rhs) { +bool equals<ConstCharPtr, vespalib::stringref>(ConstCharPtr lhs, vespalib::stringref rhs) { return strcmp(lhs, rhs.data()) == 0; } template <typename T> bool -isUndefined(const T & value, const BasicType::Type & type) +isUndefined(T value, BasicType::Type type) { switch (type) { case BasicType::INT8: @@ -70,14 +70,14 @@ isUndefined(const T & value, const BasicType::Type & type) template <> bool -isUndefined<vespalib::stringref>(const vespalib::stringref &, const BasicType::Type &) +isUndefined<vespalib::stringref>(vespalib::stringref, BasicType::Type) { return false; } template <typename T> search::feature_t -considerUndefined(const T & value, const BasicType::Type & type) +considerUndefined(T value, BasicType::Type type) { if (isUndefined(value, type)) { return search::attribute::getUndefined<search::feature_t>(); @@ -87,7 +87,7 @@ considerUndefined(const T & value, const BasicType::Type & type) template <> search::feature_t -considerUndefined<ConstCharPtr>(const ConstCharPtr & value, const BasicType::Type &) +considerUndefined<ConstCharPtr>(ConstCharPtr value, BasicType::Type ) { return search::features::util::getAsFeature(value); } @@ -96,8 +96,7 @@ considerUndefined<ConstCharPtr>(const ConstCharPtr & value, const BasicType::Typ } -namespace search { -namespace features { +namespace search::features { /** * Implements the executor for fetching values from a single or array attribute vector @@ -433,5 +432,4 @@ AttributeBlueprint::getDescriptions() const desc().attribute(dataTypeSet, fef::ParameterCollection::ANY).string(); } -} // namespace features -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/features/dotproductfeature.h b/searchlib/src/vespa/searchlib/features/dotproductfeature.h index e3cd662cdd8..c12b0f54cf6 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(const vespalib::stringref & label, const vespalib::stringref & value) { + void insert(vespalib::stringref label, const 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(const vespalib::stringref & label, const vespalib::stringref & value) { + void insert(vespalib::stringref label, const 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(const vespalib::stringref & label, const vespalib::stringref & value) { + void insert(vespalib::stringref label, const 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 583e910a593..7fdd216d447 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(const vespalib::stringref &key, const vespalib::stringref &weight) { + void insert(vespalib::stringref key, const vespalib::stringref &weight) { _data.emplace_back(key, util::strToNum<int32_t>(weight)); } }; diff --git a/searchlib/src/vespa/searchlib/features/utils.h b/searchlib/src/vespa/searchlib/features/utils.h index 57f4c83f6a9..859c66af66a 100644 --- a/searchlib/src/vespa/searchlib/features/utils.h +++ b/searchlib/src/vespa/searchlib/features/utils.h @@ -35,7 +35,7 @@ template <typename T> T strToNum(vespalib::stringref str); template <typename T> -feature_t getAsFeature(const T &value) __attribute__((__always_inline__)); +feature_t getAsFeature(T value) __attribute__((__always_inline__)); /** * Converts the given value to a feature value. @@ -44,7 +44,7 @@ feature_t getAsFeature(const T &value) __attribute__((__always_inline__)); * @return The feature value. */ template <typename T> -inline feature_t getAsFeature(const T &value) +inline feature_t getAsFeature(T value) { return static_cast<feature_t>(value); } @@ -56,7 +56,7 @@ inline feature_t getAsFeature(const T &value) * @return The feature value. */ template <> -inline feature_t getAsFeature<ConstCharPtr>(const ConstCharPtr & value) { +inline feature_t getAsFeature<ConstCharPtr>(ConstCharPtr value) { return static_cast<feature_t>(vespalib::hash_code(value, strlen(value))); } @@ -67,18 +67,7 @@ inline feature_t getAsFeature<ConstCharPtr>(const ConstCharPtr & value) { * @return The feature value. */ template <> -inline feature_t getAsFeature<vespalib::string>(const vespalib::string & value) { - return static_cast<feature_t>(vespalib::hash_code(value)); -} - -/** - * Specialization for a string value. - * - * @param value The string to convert. - * @return The feature value. - */ -template <> -inline feature_t getAsFeature<vespalib::stringref>(const vespalib::stringref & value) { +inline feature_t getAsFeature<vespalib::stringref>(vespalib::stringref value) { return static_cast<feature_t>(vespalib::hash_code(value)); } diff --git a/searchlib/src/vespa/searchlib/fef/blueprint.cpp b/searchlib/src/vespa/searchlib/fef/blueprint.cpp index 98fdea1861f..82e9a316321 100644 --- a/searchlib/src/vespa/searchlib/fef/blueprint.cpp +++ b/searchlib/src/vespa/searchlib/fef/blueprint.cpp @@ -10,7 +10,7 @@ namespace search { namespace fef { const FeatureType & -Blueprint::defineInput(const vespalib::stringref &inName, +Blueprint::defineInput(vespalib::stringref inName, AcceptInput accept) { assert(_dependency_handler != nullptr); @@ -18,7 +18,7 @@ Blueprint::defineInput(const vespalib::stringref &inName, } void -Blueprint::describeOutput(const vespalib::stringref &outName, +Blueprint::describeOutput(vespalib::stringref outName, const vespalib::stringref &desc, const FeatureType &type) { @@ -27,7 +27,7 @@ Blueprint::describeOutput(const vespalib::stringref &outName, _dependency_handler->define_output(outName, type); } -Blueprint::Blueprint(const vespalib::stringref & baseName) +Blueprint::Blueprint(vespalib::stringref baseName) : _baseName(baseName), _name(), _dependency_handler(nullptr) diff --git a/searchlib/src/vespa/searchlib/fef/blueprint.h b/searchlib/src/vespa/searchlib/fef/blueprint.h index 4605df10eda..7ac2d648cc1 100644 --- a/searchlib/src/vespa/searchlib/fef/blueprint.h +++ b/searchlib/src/vespa/searchlib/fef/blueprint.h @@ -81,7 +81,7 @@ protected: * @param inName feature name of input * @param type accepted input type **/ - const FeatureType &defineInput(const vespalib::stringref &inName, + const FeatureType &defineInput(vespalib::stringref inName, AcceptInput accept = AcceptInput::NUMBER); /** @@ -97,7 +97,7 @@ protected: * @param outName output name * @param desc output description **/ - void describeOutput(const vespalib::stringref &outName, const vespalib::stringref &desc, + void describeOutput(vespalib::stringref outName, const vespalib::stringref &desc, const FeatureType &type = FeatureType::number()); public: @@ -107,7 +107,7 @@ public: * class. The @ref setup method is used to tailor a blueprint * object for a specific set of parameters. **/ - Blueprint(const vespalib::stringref & baseName); + Blueprint(vespalib::stringref baseName); /** * Obtain the base name of this blueprint. This method will @@ -164,7 +164,7 @@ public: * before invoking the @ref setup method (and must not be invoked * by others). **/ - void setName(const vespalib::stringref &name) { _name = name; } + void setName(vespalib::stringref name) { _name = name; } /** * Obtain the name of this blueprint. diff --git a/searchlib/src/vespa/searchlib/fef/blueprintresolver.cpp b/searchlib/src/vespa/searchlib/fef/blueprintresolver.cpp index 415e5625135..a8d2e4d7f6b 100644 --- a/searchlib/src/vespa/searchlib/fef/blueprintresolver.cpp +++ b/searchlib/src/vespa/searchlib/fef/blueprintresolver.cpp @@ -192,7 +192,7 @@ BlueprintResolver::BlueprintResolver(const BlueprintFactory &factory, } void -BlueprintResolver::addSeed(const vespalib::stringref &feature) +BlueprintResolver::addSeed(vespalib::stringref feature) { _seeds.push_back(feature); } diff --git a/searchlib/src/vespa/searchlib/fef/blueprintresolver.h b/searchlib/src/vespa/searchlib/fef/blueprintresolver.h index 78cb8fa8b3d..317263260fe 100644 --- a/searchlib/src/vespa/searchlib/fef/blueprintresolver.h +++ b/searchlib/src/vespa/searchlib/fef/blueprintresolver.h @@ -101,7 +101,7 @@ public: * * @param feature feature name to use as a seed **/ - void addSeed(const vespalib::stringref &feature); + void addSeed(vespalib::stringref feature); /** * Create Blueprints for all seeds and dependencies and enumerate diff --git a/searchlib/src/vespa/searchlib/fef/parametervalidator.h b/searchlib/src/vespa/searchlib/fef/parametervalidator.h index 6bde59641da..baf2260957e 100644 --- a/searchlib/src/vespa/searchlib/fef/parametervalidator.h +++ b/searchlib/src/vespa/searchlib/fef/parametervalidator.h @@ -43,7 +43,7 @@ public: Result & operator=(Result &&) = default; ~Result(); Result & addParameter(const Parameter & param) { _params.push_back(param); return *this; } - Result & setError(const vespalib::stringref & str) { + Result & setError(vespalib::stringref str) { _errorStr = str; _params.clear(); _valid = false; diff --git a/searchlib/src/vespa/searchlib/fef/properties.cpp b/searchlib/src/vespa/searchlib/fef/properties.cpp index 132bf8d777a..280f9b3eaec 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(const vespalib::stringref &key, const vespalib::stringref &value) +Properties::add(vespalib::stringref key, const vespalib::stringref &value) { if (!key.empty()) { Value & v = _data[key]; @@ -95,7 +95,7 @@ Properties::add(const vespalib::stringref &key, const vespalib::stringref &value } uint32_t -Properties::count(const vespalib::stringref &key) const +Properties::count(vespalib::stringref key) const { if (!key.empty()) { Map::const_iterator node = _data.find(key); @@ -107,7 +107,7 @@ Properties::count(const vespalib::stringref &key) const } Properties & -Properties::remove(const vespalib::stringref &key) +Properties::remove(vespalib::stringref key) { if (!key.empty()) { Map::iterator node = _data.find(key); @@ -186,7 +186,7 @@ Properties::visitProperties(IPropertiesVisitor &visitor) const } void -Properties::visitNamespace(const vespalib::stringref &ns, +Properties::visitNamespace(vespalib::stringref ns, IPropertiesVisitor &visitor) const { vespalib::string tmp; @@ -205,7 +205,7 @@ Properties::visitNamespace(const vespalib::stringref &ns, } Property -Properties::lookup(const vespalib::stringref &key) const +Properties::lookup(vespalib::stringref key) const { if (key.empty()) { return Property(); @@ -217,7 +217,7 @@ Properties::lookup(const vespalib::stringref &key) const return Property(node->second); } -Property Properties::lookup(const vespalib::stringref &namespace1, +Property Properties::lookup(vespalib::stringref namespace1, const vespalib::stringref &key) const { if (namespace1.empty() || @@ -228,7 +228,7 @@ Property Properties::lookup(const vespalib::stringref &namespace1, return lookup(namespace1 + "." + key); } -Property Properties::lookup(const vespalib::stringref &namespace1, +Property Properties::lookup(vespalib::stringref namespace1, const vespalib::stringref &namespace2, const vespalib::stringref &key) const { @@ -241,7 +241,7 @@ Property Properties::lookup(const vespalib::stringref &namespace1, return lookup(namespace1 + "." + namespace2 + "." + key); } -Property Properties::lookup(const vespalib::stringref &namespace1, +Property Properties::lookup(vespalib::stringref namespace1, const vespalib::stringref &namespace2, const vespalib::stringref &namespace3, const vespalib::stringref &key) const diff --git a/searchlib/src/vespa/searchlib/fef/properties.h b/searchlib/src/vespa/searchlib/fef/properties.h index 06305a14ef6..9814e3023b5 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(const vespalib::stringref &key, const vespalib::stringref &value); + Properties &add(vespalib::stringref key, const vespalib::stringref &value); /** * Obtain the number of values for a given key. @@ -175,7 +175,7 @@ public: * @return number of values for the given key * @param key the key **/ - uint32_t count(const vespalib::stringref &key) const; + uint32_t count(vespalib::stringref key) const; /** * Remove all values for the given key. @@ -183,7 +183,7 @@ public: * @return this object, for chaining * @param key the key **/ - Properties &remove(const vespalib::stringref &key); + Properties &remove(vespalib::stringref key); /** * Import all key/value pairs from src into this object. All @@ -248,7 +248,7 @@ public: * @param ns the namespace to visit * @param visitor the object being notified of key/value pairs inside the namespace **/ - void visitNamespace(const vespalib::stringref &ns, + void visitNamespace(vespalib::stringref ns, IPropertiesVisitor &visitor) const; /** @@ -258,7 +258,7 @@ public: * @return object encapsulating lookup result * @param key the key to look up **/ - Property lookup(const vespalib::stringref &key) const; + Property lookup(vespalib::stringref key) const; /** * Look up a key inside a namespace using the proposed namespace @@ -271,7 +271,7 @@ public: * @param namespace1 the namespace * @param key the key to look up **/ - Property lookup(const vespalib::stringref &namespace1, + Property lookup(vespalib::stringref namespace1, const vespalib::stringref &key) const; /** @@ -286,7 +286,7 @@ public: * @param namespace the second namespace * @param key the key to look up **/ - Property lookup(const vespalib::stringref &namespace1, + Property lookup(vespalib::stringref namespace1, const vespalib::stringref &namespace2, const vespalib::stringref &key) const; @@ -303,7 +303,7 @@ public: * @param namespace the third namespace * @param key the key to look up **/ - Property lookup(const vespalib::stringref &namespace1, + Property lookup(vespalib::stringref namespace1, const vespalib::stringref &namespace2, const vespalib::stringref &namespace3, const vespalib::stringref &key) const; diff --git a/searchlib/src/vespa/searchlib/fef/test/ftlib.h b/searchlib/src/vespa/searchlib/fef/test/ftlib.h index f4e4584cda1..0f1a5d8db45 100644 --- a/searchlib/src/vespa/searchlib/fef/test/ftlib.h +++ b/searchlib/src/vespa/searchlib/fef/test/ftlib.h @@ -21,7 +21,7 @@ using search::feature_t; //--------------------------------------------------------------------------------------------------------------------- class StringList : public std::vector<vespalib::string> { public: - StringList &add(const vespalib::stringref &str) { push_back(str); return *this; } + StringList &add(vespalib::stringref str) { push_back(str); return *this; } StringList &clear() { std::vector<vespalib::string>::clear(); return *this; } }; diff --git a/searchlib/src/vespa/searchlib/index/dictionaryfile.h b/searchlib/src/vespa/searchlib/index/dictionaryfile.h index 2f673c258f3..d4de6dd0af6 100644 --- a/searchlib/src/vespa/searchlib/index/dictionaryfile.h +++ b/searchlib/src/vespa/searchlib/index/dictionaryfile.h @@ -50,7 +50,7 @@ public: /** * Write word and counts. Only nonzero counts should be supplied. */ - virtual void writeWord(const vespalib::stringref &word, const PostingListCounts &counts) = 0; + virtual void writeWord(vespalib::stringref word, const PostingListCounts &counts) = 0; }; @@ -66,7 +66,7 @@ public: DictionaryFileRandRead(); virtual ~DictionaryFileRandRead(); - virtual bool lookup(const vespalib::stringref &word, uint64_t &wordNum, + virtual bool lookup(vespalib::stringref word, uint64_t &wordNum, PostingListOffsetAndCounts &offsetAndCounts) = 0; /** diff --git a/searchlib/src/vespa/searchlib/index/indexbuilder.h b/searchlib/src/vespa/searchlib/index/indexbuilder.h index 206eb064d31..4c79e744da6 100644 --- a/searchlib/src/vespa/searchlib/index/indexbuilder.h +++ b/searchlib/src/vespa/searchlib/index/indexbuilder.h @@ -24,7 +24,7 @@ public: ~IndexBuilder(); virtual void - startWord(const vespalib::stringref & word) = 0; + startWord(vespalib::stringref word) = 0; virtual void endWord() = 0; diff --git a/searchlib/src/vespa/searchlib/index/olddictionaryfile.h b/searchlib/src/vespa/searchlib/index/olddictionaryfile.h index eef500f512a..85c0f810e1e 100644 --- a/searchlib/src/vespa/searchlib/index/olddictionaryfile.h +++ b/searchlib/src/vespa/searchlib/index/olddictionaryfile.h @@ -177,7 +177,7 @@ public: * Write word and counts. Only nonzero counts should be supplied. */ virtual void - writeWord(const vespalib::stringref &word, + writeWord(vespalib::stringref word, const std::vector<uint32_t> &indexes, const std::vector<PostingListCounts> &counts) = 0; diff --git a/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp b/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp index 36d76629f87..9f6ca50e326 100644 --- a/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp +++ b/searchlib/src/vespa/searchlib/parsequery/simplequerystack.cpp @@ -124,7 +124,7 @@ private: static ItemName _G_ItemName; vespalib::string -SimpleQueryStack::StackbufToString(const vespalib::stringref &theBuf) +SimpleQueryStack::StackbufToString(vespalib::stringref theBuf) { vespalib::string result; diff --git a/searchlib/src/vespa/searchlib/parsequery/simplequerystack.h b/searchlib/src/vespa/searchlib/parsequery/simplequerystack.h index a9d99ca93f8..47bb213a8b3 100644 --- a/searchlib/src/vespa/searchlib/parsequery/simplequerystack.h +++ b/searchlib/src/vespa/searchlib/parsequery/simplequerystack.h @@ -93,7 +93,7 @@ public: * @param theBuf The querystack encoded buffer. * @return a fresh string */ - static vespalib::string StackbufToString(const vespalib::stringref &theBuf); + static vespalib::string StackbufToString(vespalib::stringref theBuf); }; } // namespace search diff --git a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp index 1938222b4ac..0365a4d4f14 100644 --- a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp +++ b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp @@ -9,7 +9,7 @@ using search::query::PredicateQueryTerm; namespace search { -SimpleQueryStackDumpIterator::SimpleQueryStackDumpIterator(const vespalib::stringref &buf) : +SimpleQueryStackDumpIterator::SimpleQueryStackDumpIterator(vespalib::stringref buf) : _buf(buf.begin()), _bufEnd(buf.end()), _bufLen(buf.size()), diff --git a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h index dbb4becc819..c1049aabc55 100644 --- a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h +++ b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h @@ -75,7 +75,7 @@ public: * @param buf A pointer to the buffer holding the stackdump * @param buflen The length of the buffer in bytes */ - SimpleQueryStackDumpIterator(const vespalib::stringref &buf); + SimpleQueryStackDumpIterator(vespalib::stringref buf); ~SimpleQueryStackDumpIterator(); vespalib::stringref getStack() const { return vespalib::stringref(_buf, _bufLen); } diff --git a/searchlib/src/vespa/searchlib/query/queryterm.cpp b/searchlib/src/vespa/searchlib/query/queryterm.cpp index 5eabaf35378..dc23f5f34c0 100644 --- a/searchlib/src/vespa/searchlib/query/queryterm.cpp +++ b/searchlib/src/vespa/searchlib/query/queryterm.cpp @@ -348,7 +348,7 @@ QueryTermSimple::~QueryTermSimple() = default; namespace { -bool isFullRange(const vespalib::stringref & s) { +bool isFullRange(vespalib::stringref s) { const size_t sz(s.size()); return (sz >= 3u) && (s[0] == '<' || s[0] == '[') && diff --git a/searchlib/src/vespa/searchlib/query/tree/querybuilder.h b/searchlib/src/vespa/searchlib/query/tree/querybuilder.h index 3c6ff93457d..3a96de83a71 100644 --- a/searchlib/src/vespa/searchlib/query/tree/querybuilder.h +++ b/searchlib/src/vespa/searchlib/query/tree/querybuilder.h @@ -118,24 +118,24 @@ typename NodeTypes::Equiv *createEquiv(int32_t id, Weight weight) { return new typename NodeTypes::Equiv(id, weight); } template <class NodeTypes> -typename NodeTypes::Phrase *createPhrase(const vespalib::stringref &view, int32_t id, Weight weight) { +typename NodeTypes::Phrase *createPhrase(vespalib::stringref view, int32_t id, Weight weight) { return new typename NodeTypes::Phrase(view, id, weight); } template <class NodeTypes> -typename NodeTypes::SameElement *createSameElement(const vespalib::stringref &view) { +typename NodeTypes::SameElement *createSameElement(vespalib::stringref view) { return new typename NodeTypes::SameElement(view); } template <class NodeTypes> -typename NodeTypes::WeightedSetTerm *createWeightedSetTerm(const vespalib::stringref &view, int32_t id, Weight weight) { +typename NodeTypes::WeightedSetTerm *createWeightedSetTerm(vespalib::stringref view, int32_t id, Weight weight) { return new typename NodeTypes::WeightedSetTerm(view, id, weight); } template <class NodeTypes> -typename NodeTypes::DotProduct *createDotProduct(const vespalib::stringref &view, int32_t id, Weight weight) { +typename NodeTypes::DotProduct *createDotProduct(vespalib::stringref view, int32_t id, Weight weight) { return new typename NodeTypes::DotProduct(view, id, weight); } template <class NodeTypes> typename NodeTypes::WandTerm * -createWandTerm(const vespalib::stringref &view, int32_t id, Weight weight, uint32_t targetNumHits, int64_t scoreThreshold, double thresholdBoostFactor) { +createWandTerm(vespalib::stringref view, int32_t id, Weight weight, uint32_t targetNumHits, int64_t scoreThreshold, double thresholdBoostFactor) { return new typename NodeTypes::WandTerm(view, id, weight, targetNumHits, scoreThreshold, thresholdBoostFactor); } template <class NodeTypes> @@ -155,12 +155,12 @@ typename NodeTypes::ONear *createONear(size_t distance) { // Term nodes template <class NodeTypes> typename NodeTypes::NumberTerm * -createNumberTerm(const vespalib::stringref &term, const vespalib::stringref &view, int32_t id, Weight weight) { +createNumberTerm(vespalib::stringref term, const vespalib::stringref &view, int32_t id, Weight weight) { return new typename NodeTypes::NumberTerm(term, view, id, weight); } template <class NodeTypes> typename NodeTypes::PrefixTerm * -createPrefixTerm(const vespalib::stringref &term, const vespalib::stringref &view, int32_t id, Weight weight) { +createPrefixTerm(vespalib::stringref term, const vespalib::stringref &view, int32_t id, Weight weight) { return new typename NodeTypes::PrefixTerm(term, view, id, weight); } template <class NodeTypes> @@ -170,17 +170,17 @@ createRangeTerm(const Range &term, const vespalib::stringref &view, int32_t id, } template <class NodeTypes> typename NodeTypes::StringTerm * -createStringTerm(const vespalib::stringref &term, const vespalib::stringref &view, int32_t id, Weight weight) { +createStringTerm(vespalib::stringref term, const vespalib::stringref &view, int32_t id, Weight weight) { return new typename NodeTypes::StringTerm(term, view, id, weight); } template <class NodeTypes> typename NodeTypes::SubstringTerm * -createSubstringTerm(const vespalib::stringref &term, const vespalib::stringref &view, int32_t id, Weight weight) { +createSubstringTerm(vespalib::stringref term, const vespalib::stringref &view, int32_t id, Weight weight) { return new typename NodeTypes::SubstringTerm(term, view, id, weight); } template <class NodeTypes> typename NodeTypes::SuffixTerm * -createSuffixTerm(const vespalib::stringref &term, const vespalib::stringref &view, int32_t id, Weight weight) { +createSuffixTerm(vespalib::stringref term, const vespalib::stringref &view, int32_t id, Weight weight) { return new typename NodeTypes::SuffixTerm(term, view, id, weight); } @@ -198,7 +198,7 @@ createPredicateQuery(PredicateQueryTerm::UP term, const vespalib::stringref &vie template <class NodeTypes> typename NodeTypes::RegExpTerm * -createRegExpTerm(const vespalib::stringref &term, const vespalib::stringref &view, int32_t id, Weight weight) { +createRegExpTerm(vespalib::stringref term, const vespalib::stringref &view, int32_t id, Weight weight) { return new typename NodeTypes::RegExpTerm(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 557d0964bcb..3a2cc2f719e 100644 --- a/searchlib/src/vespa/searchlib/query/tree/simplequery.h +++ b/searchlib/src/vespa/searchlib/query/tree/simplequery.h @@ -27,23 +27,23 @@ struct SimpleEquiv : Equiv { : Equiv(id, weight) {} }; struct SimplePhrase : Phrase { - SimplePhrase(const vespalib::stringref &view, int32_t id, Weight weight) + SimplePhrase(vespalib::stringref view, int32_t id, Weight weight) : Phrase(view, id, weight) {} }; struct SimpleSameElement : SameElement { - SimpleSameElement(const vespalib::stringref &view) : SameElement(view) {} + SimpleSameElement(vespalib::stringref view) : SameElement(view) {} }; struct SimpleWeightedSetTerm : WeightedSetTerm { - SimpleWeightedSetTerm(const vespalib::stringref &view, int32_t id, Weight weight) + SimpleWeightedSetTerm(vespalib::stringref view, int32_t id, Weight weight) : WeightedSetTerm(view, id, weight) {} }; struct SimpleDotProduct : DotProduct { - SimpleDotProduct(const vespalib::stringref &view, int32_t id, Weight weight) + SimpleDotProduct(vespalib::stringref view, int32_t id, Weight weight) : DotProduct(view, id, weight) {} }; struct SimpleWandTerm : WandTerm { - SimpleWandTerm(const vespalib::stringref &view, int32_t id, Weight weight, + SimpleWandTerm(vespalib::stringref view, int32_t id, Weight weight, uint32_t targetNumHits, int64_t scoreThreshold, double thresholdBoostFactor) : WandTerm(view, id, weight, targetNumHits, scoreThreshold, thresholdBoostFactor) {} }; diff --git a/searchlib/src/vespa/searchlib/query/tree/term.cpp b/searchlib/src/vespa/searchlib/query/tree/term.cpp index de59752aa10..40044cc5dbe 100644 --- a/searchlib/src/vespa/searchlib/query/tree/term.cpp +++ b/searchlib/src/vespa/searchlib/query/tree/term.cpp @@ -7,7 +7,7 @@ namespace search::query { Term::~Term() = default; -Term::Term(const vespalib::stringref &view, int32_t id, Weight weight) : +Term::Term(vespalib::stringref view, int32_t id, Weight weight) : _view(view), _id(id), _weight(weight), diff --git a/searchlib/src/vespa/searchlib/query/tree/term.h b/searchlib/src/vespa/searchlib/query/tree/term.h index f931a54eda9..4fb0f44dd59 100644 --- a/searchlib/src/vespa/searchlib/query/tree/term.h +++ b/searchlib/src/vespa/searchlib/query/tree/term.h @@ -38,7 +38,7 @@ public: bool usePositionData() const { return _position_data; } protected: - Term(const vespalib::stringref &view, int32_t id, Weight weight); + Term(vespalib::stringref view, int32_t id, Weight weight); }; class TermNode : public Node, public Term { diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp index bbd50e468e2..215b4db637a 100644 --- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp +++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp @@ -86,7 +86,7 @@ TensorReader::getNumCells() { } -DenseTensorAttribute::DenseTensorAttribute(const vespalib::stringref &baseFileName, +DenseTensorAttribute::DenseTensorAttribute(vespalib::stringref baseFileName, const Config &cfg) : TensorAttribute(baseFileName, cfg, _denseTensorStore), _denseTensorStore(cfg.tensorType()) diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.h b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.h index 68ca6ae7295..1924a3c6b89 100644 --- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.h +++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.h @@ -19,7 +19,7 @@ class DenseTensorAttribute : public TensorAttribute { DenseTensorStore _denseTensorStore; public: - DenseTensorAttribute(const vespalib::stringref &baseFileName, const Config &cfg); + DenseTensorAttribute(vespalib::stringref baseFileName, const Config &cfg); virtual ~DenseTensorAttribute(); virtual void setTensor(DocId docId, const Tensor &tensor) override; virtual std::unique_ptr<Tensor> getTensor(DocId docId) const override; diff --git a/searchlib/src/vespa/searchlib/tensor/generic_tensor_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/generic_tensor_attribute.cpp index 76ce89d9b45..b63c00426fa 100644 --- a/searchlib/src/vespa/searchlib/tensor/generic_tensor_attribute.cpp +++ b/searchlib/src/vespa/searchlib/tensor/generic_tensor_attribute.cpp @@ -36,7 +36,7 @@ public: } -GenericTensorAttribute::GenericTensorAttribute(const vespalib::stringref &baseFileName, const Config &cfg) +GenericTensorAttribute::GenericTensorAttribute(vespalib::stringref baseFileName, const Config &cfg) : TensorAttribute(baseFileName, cfg, _genericTensorStore) { } diff --git a/searchlib/src/vespa/searchlib/tensor/generic_tensor_attribute.h b/searchlib/src/vespa/searchlib/tensor/generic_tensor_attribute.h index 948e72cd41a..12a2a08b930 100644 --- a/searchlib/src/vespa/searchlib/tensor/generic_tensor_attribute.h +++ b/searchlib/src/vespa/searchlib/tensor/generic_tensor_attribute.h @@ -16,7 +16,7 @@ class GenericTensorAttribute : public TensorAttribute { GenericTensorStore _genericTensorStore; // data store for serialized tensors public: - GenericTensorAttribute(const vespalib::stringref &baseFileName, const Config &cfg); + GenericTensorAttribute(vespalib::stringref baseFileName, const Config &cfg); virtual ~GenericTensorAttribute(); virtual void setTensor(DocId docId, const Tensor &tensor) override; virtual std::unique_ptr<Tensor> getTensor(DocId docId) const override; diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp index 2c005fb3277..494c12dcff9 100644 --- a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp +++ b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp @@ -38,7 +38,7 @@ shouldCreateMapper(const ValueType &tensorType) } -TensorAttribute::TensorAttribute(const vespalib::stringref &baseFileName, +TensorAttribute::TensorAttribute(vespalib::stringref baseFileName, const Config &cfg, TensorStore &tensorStore) : NotImplementedAttribute(baseFileName, cfg), diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.h b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.h index c5a76014485..1ef3d8a1a96 100644 --- a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.h +++ b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.h @@ -32,7 +32,7 @@ protected: public: DECLARE_IDENTIFIABLE_ABSTRACT(TensorAttribute); using RefCopyVector = vespalib::Array<RefType>; - TensorAttribute(const vespalib::stringref &baseFileName, const Config &cfg, + TensorAttribute(vespalib::stringref baseFileName, const Config &cfg, TensorStore &tensorStore); virtual ~TensorAttribute(); virtual const ITensorAttribute *asTensorAttribute() const override; diff --git a/searchlib/src/vespa/searchlib/transactionlog/translogserver.cpp b/searchlib/src/vespa/searchlib/transactionlog/translogserver.cpp index bfca137ba06..f9a82c8d20f 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/translogserver.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/translogserver.cpp @@ -238,7 +238,7 @@ TransLogServer::getDomainNames() } Domain::SP -TransLogServer::findDomain(const stringref &domainName) +TransLogServer::findDomain(stringref domainName) { Guard domainGuard(_lock); Domain::SP domain; diff --git a/searchlib/src/vespa/searchlib/transactionlog/translogserver.h b/searchlib/src/vespa/searchlib/transactionlog/translogserver.h index d78d3d39887..9dcc17a4a1f 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/translogserver.h +++ b/searchlib/src/vespa/searchlib/transactionlog/translogserver.h @@ -69,7 +69,7 @@ private: void logMetric() const; std::vector<vespalib::string> getDomainNames(); - Domain::SP findDomain(const vespalib::stringref &name); + Domain::SP findDomain(vespalib::stringref name); vespalib::string dir() const { return _baseDir + "/" + _name; } vespalib::string domainList() const { return dir() + "/" + _name + ".domains"; } diff --git a/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h b/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h index 44cb674597f..f7d7d7d4bb6 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h +++ b/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h @@ -39,7 +39,7 @@ public: void SetResultClassName(uint32_t len, const char *name) { _resultClassName.assign(name, len); } - void setResultClassName(const vespalib::stringref & name) { _resultClassName = name; } + void setResultClassName(vespalib::stringref name) { _resultClassName = name; } void SetStackDump(uint32_t stackItems, uint32_t stackDumpLen, const char *stackDump); void SetLocation(uint32_t locationLen, const char *location) { diff --git a/slobrok/src/vespa/slobrok/sbregister.cpp b/slobrok/src/vespa/slobrok/sbregister.cpp index a2ec4a4a7b2..27bb5fbe83b 100644 --- a/slobrok/src/vespa/slobrok/sbregister.cpp +++ b/slobrok/src/vespa/slobrok/sbregister.cpp @@ -94,7 +94,7 @@ RegisterAPI::~RegisterAPI() void -RegisterAPI::registerName(const vespalib::stringref & name) +RegisterAPI::registerName(vespalib::stringref name) { std::lock_guard<std::mutex> guard(_lock); for (uint32_t i = 0; i < _names.size(); ++i) { @@ -111,7 +111,7 @@ RegisterAPI::registerName(const vespalib::stringref & name) void -RegisterAPI::unregisterName(const vespalib::stringref & name) +RegisterAPI::unregisterName(vespalib::stringref name) { std::lock_guard<std::mutex> guard(_lock); _busy = true; diff --git a/slobrok/src/vespa/slobrok/sbregister.h b/slobrok/src/vespa/slobrok/sbregister.h index d8812c0f3d0..b910131a19a 100644 --- a/slobrok/src/vespa/slobrok/sbregister.h +++ b/slobrok/src/vespa/slobrok/sbregister.h @@ -40,13 +40,13 @@ public: * @brief Register a service with the slobrok cluster. * @param name service name to register **/ - void registerName(const vespalib::stringref & name); + void registerName(vespalib::stringref name); /** * @brief Unregister a service with the slobrok cluster * @param name service name to unregister **/ - void unregisterName(const vespalib::stringref & name); + void unregisterName(vespalib::stringref name); /** * @brief Check progress diff --git a/storage/src/vespa/storage/common/hostreporter/kernelmetrictool.cpp b/storage/src/vespa/storage/common/hostreporter/kernelmetrictool.cpp index c8d73737d7c..ea6e266f0b2 100644 --- a/storage/src/vespa/storage/common/hostreporter/kernelmetrictool.cpp +++ b/storage/src/vespa/storage/common/hostreporter/kernelmetrictool.cpp @@ -30,7 +30,7 @@ vespalib::string stripWhitespace(const vespalib::string& s) { return s.substr(start, stop - start + 1); } -vespalib::string getLine(const vespalib::stringref& key, +vespalib::string getLine(vespalib::stringref key, const vespalib::stringref& content) { vespalib::string::size_type start(0); @@ -63,7 +63,7 @@ uint32_t getTokenCount(const vespalib::string& line) { return st.size(); } -uint64_t toLong(const vespalib::stringref& s, int base) { +uint64_t toLong(vespalib::stringref s, int base) { char* endptr; // FIXME C++17 range-safe from_chars() instead of strtoull() uint64_t result(strtoull(s.data(), &endptr, base)); diff --git a/storage/src/vespa/storage/common/hostreporter/kernelmetrictool.h b/storage/src/vespa/storage/common/hostreporter/kernelmetrictool.h index dd41cb1fcd2..0d07f045de2 100644 --- a/storage/src/vespa/storage/common/hostreporter/kernelmetrictool.h +++ b/storage/src/vespa/storage/common/hostreporter/kernelmetrictool.h @@ -15,14 +15,14 @@ vespalib::string readFile(const char* fileName); vespalib::string stripWhitespace(const vespalib::string& s); -vespalib::string getLine(const vespalib::stringref& key, +vespalib::string getLine(vespalib::stringref key, const vespalib::stringref& content); vespalib::string getToken(uint32_t index, const vespalib::string& line); uint32_t getTokenCount(const vespalib::string& line); -uint64_t toLong(const vespalib::stringref& s, int base = 0) ; +uint64_t toLong(vespalib::stringref s, int base = 0) ; } /* namespace kernelmetrictool */ } /* namespace storage */ diff --git a/storage/src/vespa/storage/config/distributorconfiguration.h b/storage/src/vespa/storage/config/distributorconfiguration.h index d3e589f9d00..8c2e0568796 100644 --- a/storage/src/vespa/storage/config/distributorconfiguration.h +++ b/storage/src/vespa/storage/config/distributorconfiguration.h @@ -70,11 +70,11 @@ public: _lastGarbageCollectionChange = lastChangeTime; } - bool stateCheckerIsActive(const vespalib::stringref & stateCheckerName) const { + bool stateCheckerIsActive(vespalib::stringref stateCheckerName) const { return _blockedStateCheckers.find(stateCheckerName) == _blockedStateCheckers.end(); } - void disableStateChecker(const vespalib::stringref & stateCheckerName) { + void disableStateChecker(vespalib::stringref stateCheckerName) { _blockedStateCheckers.insert(stateCheckerName); } diff --git a/storage/src/vespa/storage/storageserver/fnetlistener.cpp b/storage/src/vespa/storage/storageserver/fnetlistener.cpp index 32ea8982ffb..d92b672c52a 100644 --- a/storage/src/vespa/storage/storageserver/fnetlistener.cpp +++ b/storage/src/vespa/storage/storageserver/fnetlistener.cpp @@ -43,7 +43,7 @@ FNetListener::getListenPort() const } void -FNetListener::registerHandle(const vespalib::stringref & handle) { +FNetListener::registerHandle(vespalib::stringref handle) { _slobrokRegister.registerName(handle); while (_slobrokRegister.busy()) { LOG(debug, "Waiting to register in slobrok"); diff --git a/storage/src/vespa/storage/storageserver/fnetlistener.h b/storage/src/vespa/storage/storageserver/fnetlistener.h index bf004a3eb2b..2ffdae24b29 100644 --- a/storage/src/vespa/storage/storageserver/fnetlistener.h +++ b/storage/src/vespa/storage/storageserver/fnetlistener.h @@ -27,7 +27,7 @@ public: void RPC_getCurrentTime(FRT_RPCRequest *req); void RPC_setDistributionStates(FRT_RPCRequest* req); - void registerHandle(const vespalib::stringref & handle); + void registerHandle(vespalib::stringref handle); void close(); int getListenPort() const; diff --git a/storage/src/vespa/storage/visiting/visitorthread.cpp b/storage/src/vespa/storage/visiting/visitorthread.cpp index 6bf28b08540..f0374e07ef7 100644 --- a/storage/src/vespa/storage/visiting/visitorthread.cpp +++ b/storage/src/vespa/storage/visiting/visitorthread.cpp @@ -365,7 +365,7 @@ VisitorThread::handleNonExistingVisitorCall(const Event& entry, * Utility function to get a visitor instance from a given library. */ std::shared_ptr<Visitor> -VisitorThread::createVisitor(const vespalib::stringref & libName, +VisitorThread::createVisitor(vespalib::stringref libName, const vdslib::Parameters& params, vespalib::asciistream & error) { diff --git a/storage/src/vespa/storage/visiting/visitorthread.h b/storage/src/vespa/storage/visiting/visitorthread.h index 97ca70f3761..483837ed741 100644 --- a/storage/src/vespa/storage/visiting/visitorthread.h +++ b/storage/src/vespa/storage/visiting/visitorthread.h @@ -125,7 +125,7 @@ private: void trimRecentlyCompletedList(framework::SecondTime currentTime); void handleNonExistingVisitorCall(const Event& entry, api::ReturnCode& code); - std::shared_ptr<Visitor> createVisitor(const vespalib::stringref & libName, + std::shared_ptr<Visitor> createVisitor(vespalib::stringref libName, const vdslib::Parameters& params, vespalib::asciistream & error); diff --git a/storageapi/src/vespa/storageapi/message/persistence.h b/storageapi/src/vespa/storageapi/message/persistence.h index 59934154cf5..c27264624b7 100644 --- a/storageapi/src/vespa/storageapi/message/persistence.h +++ b/storageapi/src/vespa/storageapi/message/persistence.h @@ -194,7 +194,7 @@ public: const document::DocumentId& getDocumentId() const { return _docId; } Timestamp getBeforeTimestamp() const { return _beforeTimestamp; } const vespalib::string& getFieldSet() const { return _fieldSet; } - void setFieldSet(const vespalib::stringref & fieldSet) { _fieldSet = fieldSet; } + void setFieldSet(vespalib::stringref fieldSet) { _fieldSet = fieldSet; } vespalib::string getSummary() const override; void print(std::ostream& out, bool verbose, const std::string& indent) const override; diff --git a/storageapi/src/vespa/storageapi/message/removelocation.cpp b/storageapi/src/vespa/storageapi/message/removelocation.cpp index ab44f0e6890..ac50bdd6a1e 100644 --- a/storageapi/src/vespa/storageapi/message/removelocation.cpp +++ b/storageapi/src/vespa/storageapi/message/removelocation.cpp @@ -8,7 +8,7 @@ namespace storage::api { IMPLEMENT_COMMAND(RemoveLocationCommand, RemoveLocationReply) IMPLEMENT_REPLY(RemoveLocationReply) -RemoveLocationCommand::RemoveLocationCommand(const vespalib::stringref & documentSelection, +RemoveLocationCommand::RemoveLocationCommand(vespalib::stringref documentSelection, const document::Bucket &bucket) : BucketInfoCommand(MessageType::REMOVELOCATION, bucket), _documentSelection(documentSelection) diff --git a/storageapi/src/vespa/storageapi/message/removelocation.h b/storageapi/src/vespa/storageapi/message/removelocation.h index 54edbc5916e..cdf43219169 100644 --- a/storageapi/src/vespa/storageapi/message/removelocation.h +++ b/storageapi/src/vespa/storageapi/message/removelocation.h @@ -10,7 +10,7 @@ namespace storage::api { class RemoveLocationCommand : public BucketInfoCommand { public: - RemoveLocationCommand(const vespalib::stringref & documentSelection, const document::Bucket &bucket); + RemoveLocationCommand(vespalib::stringref documentSelection, const document::Bucket &bucket); ~RemoveLocationCommand(); void print(std::ostream& out, bool verbose, const std::string& indent) const override; diff --git a/storageapi/src/vespa/storageapi/message/visitor.cpp b/storageapi/src/vespa/storageapi/message/visitor.cpp index 3cb6f72d5d9..2597b818d10 100644 --- a/storageapi/src/vespa/storageapi/message/visitor.cpp +++ b/storageapi/src/vespa/storageapi/message/visitor.cpp @@ -140,7 +140,7 @@ CreateVisitorReply::print(std::ostream& out, bool verbose, } } -DestroyVisitorCommand::DestroyVisitorCommand(const vespalib::stringref & instanceId) +DestroyVisitorCommand::DestroyVisitorCommand(vespalib::stringref instanceId) : StorageCommand(MessageType::VISITOR_DESTROY), _instanceId(instanceId) { diff --git a/storageapi/src/vespa/storageapi/message/visitor.h b/storageapi/src/vespa/storageapi/message/visitor.h index 0e78ea93753..c1dc65a23d6 100644 --- a/storageapi/src/vespa/storageapi/message/visitor.h +++ b/storageapi/src/vespa/storageapi/message/visitor.h @@ -63,13 +63,13 @@ public: ~CreateVisitorCommand(); void setVisitorCmdId(uint32_t id) { _visitorCmdId = id; } - void setControlDestination(const vespalib::stringref & d) + void setControlDestination(vespalib::stringref d) { _controlDestination = d; } - void setDataDestination(const vespalib::stringref & d) { _dataDestination = d; } + void setDataDestination(vespalib::stringref d) { _dataDestination = d; } void setParameters(const vdslib::Parameters& params) { _params = params; } void setMaximumPendingReplyCount(uint32_t count) { _maxPendingReplyCount = count; } - void setFieldSet(const vespalib::stringref& fieldSet) + void setFieldSet(vespalib::stringref fieldSet) { _fieldSet = fieldSet; } void setVisitRemoves(bool value = true) { _visitRemoves = value; } void setVisitInconsistentBuckets(bool visitInconsistent = true) @@ -77,7 +77,7 @@ public: void addBucketToBeVisited(const document::BucketId& id) { _buckets.push_back(id); } void setVisitorId(const VisitorId id) { _visitorId = id; } - void setInstanceId(const vespalib::stringref & id) { _instanceId = id; } + void setInstanceId(vespalib::stringref id) { _instanceId = id; } void setQueueTimeout(uint32_t milliSecs) { _queueTimeout = milliSecs; } void setFromTime(Timestamp ts) { _fromTime = ts; } void setToTime(Timestamp ts) { _toTime = ts; } @@ -157,7 +157,7 @@ private: vespalib::string _instanceId; public: - explicit DestroyVisitorCommand(const vespalib::stringref & instanceId); + explicit DestroyVisitorCommand(vespalib::stringref instanceId); const vespalib::string & getInstanceId() const { return _instanceId; } diff --git a/storageapi/src/vespa/storageapi/messageapi/maintenancecommand.h b/storageapi/src/vespa/storageapi/messageapi/maintenancecommand.h index 7e9a41e6220..3bf65d3ac15 100644 --- a/storageapi/src/vespa/storageapi/messageapi/maintenancecommand.h +++ b/storageapi/src/vespa/storageapi/messageapi/maintenancecommand.h @@ -17,7 +17,7 @@ public: ~MaintenanceCommand(); const vespalib::string& getReason() const { return _reason; }; - void setReason(const vespalib::stringref & reason) { _reason = reason; }; + void setReason(vespalib::stringref reason) { _reason = reason; }; protected: vespalib::string _reason; }; diff --git a/storageapi/src/vespa/storageapi/messageapi/returncode.h b/storageapi/src/vespa/storageapi/messageapi/returncode.h index 78f2168e170..6e2aa79f09f 100644 --- a/storageapi/src/vespa/storageapi/messageapi/returncode.h +++ b/storageapi/src/vespa/storageapi/messageapi/returncode.h @@ -87,7 +87,7 @@ public: size_t getSerializedSize() const override; const vespalib::string& getMessage() const { return _message; } - void setMessage(const vespalib::stringref & message) { _message = message; } + void setMessage(vespalib::stringref message) { _message = message; } Result getResult() const { return _result; } diff --git a/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp b/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp index 380d846dd93..39ece68d2fe 100644 --- a/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp +++ b/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp @@ -123,7 +123,7 @@ MessageType::MessageType::get(Id id) } return *it->second; } -MessageType::MessageType(const vespalib::stringref & name, Id id, +MessageType::MessageType(vespalib::stringref name, Id id, const MessageType* replyOf) : _name(name), _id(id), _reply(NULL), _replyOf(replyOf) { @@ -163,14 +163,14 @@ std::ostream & operator << (std::ostream & os, const StorageMessageAddress & add } static vespalib::string -createAddress(const vespalib::stringref & cluster, const lib::NodeType& type, uint16_t index) +createAddress(vespalib::stringref cluster, const lib::NodeType& type, uint16_t index) { vespalib::asciistream os; os << STORAGEADDRESS_PREFIX << cluster << '/' << type.toString() << '/' << index << "/default"; return os.str(); } -StorageMessageAddress::StorageMessageAddress(const vespalib::stringref & cluster, const lib::NodeType& type, +StorageMessageAddress::StorageMessageAddress(vespalib::stringref cluster, const lib::NodeType& type, uint16_t index, Protocol protocol) : _route(), _retryEnabled(false), diff --git a/storageapi/src/vespa/storageapi/messageapi/storagemessage.h b/storageapi/src/vespa/storageapi/messageapi/storagemessage.h index 6c561f3af21..34ad25e76cf 100644 --- a/storageapi/src/vespa/storageapi/messageapi/storagemessage.h +++ b/storageapi/src/vespa/storageapi/messageapi/storagemessage.h @@ -163,7 +163,7 @@ private: MessageType *_reply; const MessageType *_replyOf; - MessageType(const vespalib::stringref & name, Id id, const MessageType* replyOf = 0); + MessageType(vespalib::stringref name, Id id, const MessageType* replyOf = 0); public: static const MessageType DOCBLOCK; static const MessageType DOCBLOCK_REPLY; @@ -280,7 +280,7 @@ private: public: StorageMessageAddress(const mbus::Route& route); - StorageMessageAddress(const vespalib::stringref & clusterName, + StorageMessageAddress(vespalib::stringref clusterName, const lib::NodeType& type, uint16_t index, Protocol protocol = STORAGE); ~StorageMessageAddress(); |