diff options
26 files changed, 74 insertions, 80 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h b/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h index 8cca0165cd7..d1450f957de 100644 --- a/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h +++ b/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h @@ -34,7 +34,7 @@ private: vespalib::string path_prefix; const JsonGetHandler *handler; Hook(size_t seq_in, - const vespalib::stringref &prefix_in, + vespalib::stringref prefix_in, const JsonGetHandler &handler_in) : seq(seq_in), path_prefix(prefix_in), handler(&handler_in) {} bool operator <(const Hook &rhs) const { diff --git a/staging_vespalib/src/vespa/vespalib/objects/asciiserializer.cpp b/staging_vespalib/src/vespa/vespalib/objects/asciiserializer.cpp index 5006e267acc..698900a8e80 100644 --- a/staging_vespalib/src/vespa/vespalib/objects/asciiserializer.cpp +++ b/staging_vespalib/src/vespa/vespalib/objects/asciiserializer.cpp @@ -39,7 +39,7 @@ AsciiSerializer &AsciiSerializer::put(const IFieldBase &, double value) { return *this; } -AsciiSerializer &AsciiSerializer::put(const IFieldBase &, const stringref & value) { +AsciiSerializer &AsciiSerializer::put(const IFieldBase &, stringref value) { _stream << value; return *this; } diff --git a/staging_vespalib/src/vespa/vespalib/objects/asciiserializer.h b/staging_vespalib/src/vespa/vespalib/objects/asciiserializer.h index 999adcce575..0066c96934e 100644 --- a/staging_vespalib/src/vespa/vespalib/objects/asciiserializer.h +++ b/staging_vespalib/src/vespa/vespalib/objects/asciiserializer.h @@ -18,7 +18,7 @@ public: AsciiSerializer &put(const IFieldBase &field, uint64_t value) override; AsciiSerializer &put(const IFieldBase &field, float value) override; AsciiSerializer &put(const IFieldBase &field, double value) override; - AsciiSerializer &put(const IFieldBase &field, const stringref &val) override; + AsciiSerializer &put(const IFieldBase &field, stringref val) override; const asciistream &getStream() const { return _stream; } asciistream &getStream() { return _stream; } diff --git a/staging_vespalib/src/vespa/vespalib/objects/nboserializer.cpp b/staging_vespalib/src/vespa/vespalib/objects/nboserializer.cpp index 91c2eb7239b..e56ca6ca026 100644 --- a/staging_vespalib/src/vespa/vespalib/objects/nboserializer.cpp +++ b/staging_vespalib/src/vespa/vespalib/objects/nboserializer.cpp @@ -43,7 +43,7 @@ NBOSerializer &NBOSerializer::put(const IFieldBase &, double value) { return *this; } -NBOSerializer &NBOSerializer::put(const IFieldBase &, const stringref & value) { +NBOSerializer &NBOSerializer::put(const IFieldBase &, stringref value) { _stream << value; return *this; } diff --git a/staging_vespalib/src/vespa/vespalib/objects/nboserializer.h b/staging_vespalib/src/vespa/vespalib/objects/nboserializer.h index 516005c2b3f..ee75710dbfb 100644 --- a/staging_vespalib/src/vespa/vespalib/objects/nboserializer.h +++ b/staging_vespalib/src/vespa/vespalib/objects/nboserializer.h @@ -18,7 +18,7 @@ public: NBOSerializer &put(const IFieldBase &field, uint64_t value) override; NBOSerializer &put(const IFieldBase &field, float value) override; NBOSerializer &put(const IFieldBase &field, double value) override; - NBOSerializer &put(const IFieldBase &field, const stringref &val) override; + NBOSerializer &put(const IFieldBase &field, stringref val) override; NBOSerializer &get(const IFieldBase &field, bool &value) override; NBOSerializer &get(const IFieldBase &field, uint8_t &value) override; diff --git a/staging_vespalib/src/vespa/vespalib/objects/serializer.h b/staging_vespalib/src/vespa/vespalib/objects/serializer.h index 7d506d6a6bd..0458903e830 100644 --- a/staging_vespalib/src/vespa/vespalib/objects/serializer.h +++ b/staging_vespalib/src/vespa/vespalib/objects/serializer.h @@ -21,7 +21,7 @@ public: virtual Serializer & put(const IFieldBase & field, uint64_t value) = 0; virtual Serializer & put(const IFieldBase & field, float value) = 0; virtual Serializer & put(const IFieldBase & field, double value) = 0; - virtual Serializer & put(const IFieldBase & field, const stringref & value) = 0; + virtual Serializer & put(const IFieldBase & field, stringref value) = 0; virtual Serializer & put(const IFieldBase & field, const Identifiable & value); virtual Serializer & put(const IFieldBase & field, int8_t value); @@ -40,7 +40,7 @@ public: Serializer & operator << (int64_t value) { return put(_unspecifiedField, value); } Serializer & operator << (float value) { return put(_unspecifiedField, value); } Serializer & operator << (double value) { return put(_unspecifiedField, value); } - Serializer & operator << (const stringref & value) { return put(_unspecifiedField, value); } + Serializer & operator << (stringref value) { return put(_unspecifiedField, value); } template <typename T> Serializer & operator << (const vespalib::Array<T> & v); template <typename T> diff --git a/staging_vespalib/src/vespa/vespalib/objects/visit.h b/staging_vespalib/src/vespa/vespalib/objects/visit.h index 4d45ceea7fb..22c73dceefd 100644 --- a/staging_vespalib/src/vespa/vespalib/objects/visit.h +++ b/staging_vespalib/src/vespa/vespalib/objects/visit.h @@ -22,5 +22,5 @@ void visit(vespalib::ObjectVisitor &self, const vespalib::string &name, uint64_t void visit(vespalib::ObjectVisitor &self, const vespalib::string &name, float value); void visit(vespalib::ObjectVisitor &self, const vespalib::string &name, double value); void visit(vespalib::ObjectVisitor &self, const vespalib::string &name, const vespalib::string &value); -void visit(vespalib::ObjectVisitor &self, const vespalib::string &name, const vespalib::stringref &value); +void visit(vespalib::ObjectVisitor &self, const vespalib::string &name, vespalib::stringref value); void visit(vespalib::ObjectVisitor &self, const vespalib::string &name, const char *value); diff --git a/staging_vespalib/src/vespa/vespalib/util/xmlstream.cpp b/staging_vespalib/src/vespa/vespalib/util/xmlstream.cpp index 0390933f89a..6399faeefec 100644 --- a/staging_vespalib/src/vespa/vespalib/util/xmlstream.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/xmlstream.cpp @@ -446,18 +446,18 @@ XmlContentWrapper::XmlContentWrapper(const char* value, uint32_t size) using CharP = char *; using ConstCharP = const char *; -template XmlAttribute::XmlAttribute(const std::string &, const std::string &, unsigned int); -template XmlAttribute::XmlAttribute(const std::string &, const vespalib::string &, unsigned int); -template XmlAttribute::XmlAttribute(const std::string &, const vespalib::stringref &, unsigned int); -template XmlAttribute::XmlAttribute(const std::string &, const CharP &, unsigned int); -template XmlAttribute::XmlAttribute(const std::string &, const ConstCharP &, unsigned int); -template XmlAttribute::XmlAttribute(const std::string &, const bool &, unsigned int); -template XmlAttribute::XmlAttribute(const std::string &, const int16_t &, unsigned int); -template XmlAttribute::XmlAttribute(const std::string &, const int32_t &, unsigned int); -template XmlAttribute::XmlAttribute(const std::string &, const int64_t &, unsigned int); -template XmlAttribute::XmlAttribute(const std::string &, const uint16_t &, unsigned int); -template XmlAttribute::XmlAttribute(const std::string &, const uint32_t &, unsigned int); -template XmlAttribute::XmlAttribute(const std::string &, const uint64_t &, unsigned int); -template XmlAttribute::XmlAttribute(const std::string &, const double &, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, std::string, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, vespalib::string, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, vespalib::stringref, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, CharP, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, ConstCharP, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, bool, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, int16_t, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, int32_t, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, int64_t, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, uint16_t, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, uint32_t, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, uint64_t, unsigned int); +template XmlAttribute::XmlAttribute(const std::string &, double, unsigned int); } diff --git a/staging_vespalib/src/vespa/vespalib/util/xmlstream.h b/staging_vespalib/src/vespa/vespalib/util/xmlstream.h index 3185fa8c119..5455251eea1 100644 --- a/staging_vespalib/src/vespa/vespalib/util/xmlstream.h +++ b/staging_vespalib/src/vespa/vespalib/util/xmlstream.h @@ -90,7 +90,7 @@ public: XmlAttribute(const XmlAttribute&); /** Add any value that can be written to an ostringstream. */ template<typename T> - XmlAttribute(const std::string& name, const T& value, uint32_t flags = NONE); + XmlAttribute(const std::string& name, T value, uint32_t flags = NONE); XmlAttribute(const std::string& name, const char * value, uint32_t flags = NONE); ~XmlAttribute(); diff --git a/staging_vespalib/src/vespa/vespalib/util/xmlstream.hpp b/staging_vespalib/src/vespa/vespalib/util/xmlstream.hpp index babcf91e791..7ee7d8d0b82 100644 --- a/staging_vespalib/src/vespa/vespalib/util/xmlstream.hpp +++ b/staging_vespalib/src/vespa/vespalib/util/xmlstream.hpp @@ -9,7 +9,7 @@ namespace vespalib::xml { template<typename T> -XmlAttribute::XmlAttribute(const std::string& name, const T& value, uint32_t flags) +XmlAttribute::XmlAttribute(const std::string& name, T value, uint32_t flags) : _name(name), _value(), _next() diff --git a/vdslib/src/vespa/vdslib/state/diskstate.cpp b/vdslib/src/vespa/vdslib/state/diskstate.cpp index 56e9f36b442..0f41bada230 100644 --- a/vdslib/src/vespa/vdslib/state/diskstate.cpp +++ b/vdslib/src/vespa/vdslib/state/diskstate.cpp @@ -20,7 +20,7 @@ DiskState::DiskState() setState(State::UP); } -DiskState::DiskState(const State& state, const vespalib::stringref & description, +DiskState::DiskState(const State& state, vespalib::stringref description, double capacity) : _state(0), _description(description), @@ -79,7 +79,7 @@ DiskState::DiskState(vespalib::stringref serialized) } void -DiskState::serialize(vespalib::asciistream & out, const vespalib::stringref & prefix, +DiskState::serialize(vespalib::asciistream & out, vespalib::stringref prefix, bool includeDescription, bool useOldFormat) const { // Always give node state if not part of a system state diff --git a/vdslib/src/vespa/vdslib/state/diskstate.h b/vdslib/src/vespa/vdslib/state/diskstate.h index fb71f5c9733..7c50ea9dacc 100644 --- a/vdslib/src/vespa/vdslib/state/diskstate.h +++ b/vdslib/src/vespa/vdslib/state/diskstate.h @@ -22,10 +22,10 @@ public: typedef std::shared_ptr<DiskState> SP; DiskState(); - DiskState(const State&, const vespalib::stringref & description = "", double capacity = 1.0); + DiskState(const State&, vespalib::stringref description = "", double capacity = 1.0); explicit DiskState(vespalib::stringref serialized); - void serialize(vespalib::asciistream & out, const vespalib::stringref & prefix = "", + void serialize(vespalib::asciistream & out, vespalib::stringref prefix = "", bool includeReason = true, bool useOldFormat = false) const; const State& getState() const { return *_state; } diff --git a/vdslib/src/vespa/vdslib/state/nodestate.cpp b/vdslib/src/vespa/vdslib/state/nodestate.cpp index c6da5757de3..3ca92d6730d 100644 --- a/vdslib/src/vespa/vdslib/state/nodestate.cpp +++ b/vdslib/src/vespa/vdslib/state/nodestate.cpp @@ -37,7 +37,7 @@ NodeState::NodeState() } NodeState::NodeState(const NodeType& type, const State& state, - const vespalib::stringref & description, + vespalib::stringref description, double capacity, uint16_t reliability) : _type(&type), _state(0), @@ -269,7 +269,7 @@ namespace { } void -NodeState::serialize(vespalib::asciistream & out, const vespalib::stringref & prefix, +NodeState::serialize(vespalib::asciistream & out, vespalib::stringref prefix, bool includeDescription, bool includeDiskDescription, bool useOldFormat) const { diff --git a/vdslib/src/vespa/vdslib/state/nodestate.h b/vdslib/src/vespa/vdslib/state/nodestate.h index fef251bdaf1..75cf5044acc 100644 --- a/vdslib/src/vespa/vdslib/state/nodestate.h +++ b/vdslib/src/vespa/vdslib/state/nodestate.h @@ -43,7 +43,7 @@ public: NodeState(NodeState &&); NodeState & operator = (NodeState &&); NodeState(const NodeType& nodeType, const State&, - const vespalib::stringref & description = "", + vespalib::stringref description = "", double capacity = 1.0, uint16_t reliability = 1); /** Set type if you want to verify that content fit with the given type. */ NodeState(vespalib::stringref serialized, const NodeType* nodeType = 0); @@ -54,7 +54,7 @@ public: * part of the system state. Don't set prefix if you want to be able to * recreate the nodestate with NodeState(string) function. */ - void serialize(vespalib::asciistream & out, const vespalib::stringref & prefix = "", + void serialize(vespalib::asciistream & out, vespalib::stringref prefix = "", bool includeDescription = true, bool includeDiskDescription = false, bool useOldFormat = false) const; diff --git a/vdslib/src/vespa/vdslib/state/state.cpp b/vdslib/src/vespa/vdslib/state/state.cpp index b3109492c90..041753beb82 100644 --- a/vdslib/src/vespa/vdslib/state/state.cpp +++ b/vdslib/src/vespa/vdslib/state/state.cpp @@ -39,7 +39,7 @@ State::get(vespalib::stringref serialized) "Unknown state " + serialized + " given.", VESPA_STRLOC); } -State::State(vespalib::stringref name, const vespalib::stringref & serialized, +State::State(vespalib::stringref name, vespalib::stringref serialized, uint8_t rank, bool validDisk, bool validDistributorReported, bool validStorageReported, bool validDistributorWanted, bool validStorageWanted, diff --git a/vdslib/src/vespa/vdslib/state/state.h b/vdslib/src/vespa/vdslib/state/state.h index 75f5e1cbb8e..eb1c9841053 100644 --- a/vdslib/src/vespa/vdslib/state/state.h +++ b/vdslib/src/vespa/vdslib/state/state.h @@ -26,7 +26,7 @@ class State : public vespalib::Printable { bool _validClusterState; State(const State&); - State(vespalib::stringref name, const vespalib::stringref & serialized, + State(vespalib::stringref name, vespalib::stringref serialized, uint8_t rank, bool validDisk, bool validDistributorReported, bool validStorageReported, bool validDistributorWanted, bool validStorageWanted, diff --git a/vespalib/src/vespa/vespalib/component/version.cpp b/vespalib/src/vespa/vespalib/component/version.cpp index 3aa8e134e36..fc7ee703e7f 100644 --- a/vespalib/src/vespa/vespalib/component/version.cpp +++ b/vespalib/src/vespa/vespalib/component/version.cpp @@ -63,8 +63,8 @@ Version::verifySanity() } // Precondition: input.empty() == false -static int parseInteger(const stringref & input) __attribute__((noinline)); -static int parseInteger(const stringref & input) +static int parseInteger(stringref input) __attribute__((noinline)); +static int parseInteger(stringref input) { const char *s = input.data(); unsigned char firstDigit = s[0]; diff --git a/vespalib/src/vespa/vespalib/text/stringtokenizer.cpp b/vespalib/src/vespa/vespalib/text/stringtokenizer.cpp index 0e739d5b9b0..0191fdf7929 100644 --- a/vespalib/src/vespa/vespalib/text/stringtokenizer.cpp +++ b/vespalib/src/vespa/vespalib/text/stringtokenizer.cpp @@ -46,7 +46,7 @@ Token stripString(vespalib::stringref source, } void parse(TokenList& output, - const vespalib::stringref & source, + vespalib::stringref source, const AsciiSet & separators, const AsciiSet & strip) { @@ -67,8 +67,8 @@ void parse(TokenList& output, namespace vespalib { StringTokenizer::StringTokenizer(vespalib::stringref source, - const vespalib::stringref & separators, - const vespalib::stringref & strip) + vespalib::stringref separators, + vespalib::stringref strip) : _tokens() { AsciiSet sep(separators); diff --git a/vespalib/src/vespa/vespalib/text/stringtokenizer.h b/vespalib/src/vespa/vespalib/text/stringtokenizer.h index a54bcc7997e..5375a251b1b 100644 --- a/vespalib/src/vespa/vespalib/text/stringtokenizer.h +++ b/vespalib/src/vespa/vespalib/text/stringtokenizer.h @@ -42,8 +42,8 @@ public: * @param strip Characters to be stripped from both ends of each token **/ StringTokenizer(vespalib::stringref source, - const vespalib::stringref & separators = ",", - const vespalib::stringref & strip = " \t\f\r\n"); + vespalib::stringref separators = ",", + vespalib::stringref strip = " \t\f\r\n"); /** Remove any empty tokens from the token list */ void removeEmptyTokens(); diff --git a/vespalib/src/vespa/vespalib/text/utf8.h b/vespalib/src/vespa/vespalib/text/utf8.h index 6a25ef4f21e..0c75203fbbe 100644 --- a/vespalib/src/vespa/vespalib/text/utf8.h +++ b/vespalib/src/vespa/vespalib/text/utf8.h @@ -176,7 +176,7 @@ public: * Construct a reader for the given block of data * @param input data to read UTF-8 from (can be read-only) **/ - Utf8Reader(const stringref &input) + Utf8Reader(stringref input) : stringref(input), _pos(0) {} diff --git a/vespalib/src/vespa/vespalib/util/exception.cpp b/vespalib/src/vespa/vespalib/util/exception.cpp index fc2edda0c54..318b167d27b 100644 --- a/vespalib/src/vespa/vespalib/util/exception.cpp +++ b/vespalib/src/vespa/vespalib/util/exception.cpp @@ -58,7 +58,7 @@ swap(ExceptionPtr &a, ExceptionPtr &b) //----------------------------------------------------------------------------- -Exception::Exception(const stringref &msg, const stringref &location, +Exception::Exception(stringref msg, stringref location, int skipStack) : _what(), _msg(msg), @@ -69,8 +69,8 @@ Exception::Exception(const stringref &msg, const stringref &location, { } -Exception::Exception(const stringref &msg, const Exception &cause, - const stringref &location, int skipStack) +Exception::Exception(stringref msg, const Exception &cause, + stringref location, int skipStack) : _what(), _msg(msg), _location(location), diff --git a/vespalib/src/vespa/vespalib/util/exception.h b/vespalib/src/vespa/vespalib/util/exception.h index b3c63a17b3a..097ecc131c7 100644 --- a/vespalib/src/vespa/vespalib/util/exception.h +++ b/vespalib/src/vespa/vespalib/util/exception.h @@ -62,9 +62,9 @@ class MyClass : public Parent { \ public: \ MyClass(vespalib::stringref msg, \ - const vespalib::stringref &location = "", int skipStack = 0); \ + vespalib::stringref location = "", int skipStack = 0); \ MyClass(vespalib::stringref msg, const Exception &cause, \ - const vespalib::stringref &location = "", int skipStack = 0); \ + vespalib::stringref location = "", int skipStack = 0); \ VESPA_DEFINE_EXCEPTION_SPINE(MyClass) \ }; @@ -78,10 +78,10 @@ public: \ **/ #define VESPA_IMPLEMENT_EXCEPTION(MyClass, Parent) \ MyClass::MyClass(vespalib::stringref msg, \ - const vespalib::stringref &location, int skipStack) \ + vespalib::stringref location, int skipStack) \ : Parent(msg, location, skipStack + 1) {} \ MyClass::MyClass(vespalib::stringref msg, const Exception &cause, \ - const vespalib::stringref &location, int skipStack) \ + vespalib::stringref location, int skipStack) \ : Parent(msg, cause, location, skipStack + 1) {} \ VESPA_IMPLEMENT_EXCEPTION_SPINE(MyClass) @@ -186,7 +186,7 @@ public: * should send (skipStack + 1) to the parent constructor (see * \ref VESPA_DEFINE_EXCEPTION for subclass implementation). **/ - Exception(const stringref &msg, const stringref& location = "", int skipStack = 0); + Exception(stringref msg, stringref location = "", int skipStack = 0); /** * @brief Construct an exception with a message, a causing exception, and a source code location. * @param msg A user-readable message describing the problem @@ -198,8 +198,8 @@ public: * should send (skipStack + 1) to the parent constructor (see * \ref VESPA_DEFINE_EXCEPTION for subclass implementation). **/ - Exception(const stringref &msg, const Exception &cause, - const stringref &location = "", int skipStack = 0); + Exception(stringref msg, const Exception &cause, + stringref location = "", int skipStack = 0); Exception(const Exception &); Exception & operator = (const Exception &); Exception(Exception &&) = default; diff --git a/vespalib/src/vespa/vespalib/util/exceptions.cpp b/vespalib/src/vespa/vespalib/util/exceptions.cpp index fc64aa79ca4..cdfa91c25ac 100644 --- a/vespalib/src/vespa/vespalib/util/exceptions.cpp +++ b/vespalib/src/vespa/vespalib/util/exceptions.cpp @@ -70,27 +70,27 @@ SilenceUncaughtException::~SilenceUncaughtException() } vespalib::string -PortListenException::make_message(int port, const vespalib::stringref &protocol, - const vespalib::stringref &msg) +PortListenException::make_message(int port, vespalib::stringref protocol, + vespalib::stringref msg) { return make_string("failed to listen on port %d with protocol %s%s%s", port, vespalib::string(protocol).c_str(), msg.empty() ? "" : ": ", vespalib::string(msg).c_str()); } -PortListenException::PortListenException(int port, const vespalib::stringref &protocol, - const vespalib::stringref &msg, - const vespalib::stringref &location, int skipStack) +PortListenException::PortListenException(int port, vespalib::stringref protocol, + vespalib::stringref msg, + vespalib::stringref location, int skipStack) : Exception(make_message(port, protocol, msg), location, skipStack + 1), _port(port), _protocol(protocol) { } -PortListenException::PortListenException(int port, const vespalib::stringref &protocol, +PortListenException::PortListenException(int port, vespalib::stringref protocol, const Exception &cause, - const vespalib::stringref &msg, - const vespalib::stringref &location, int skipStack) + vespalib::stringref msg, + vespalib::stringref location, int skipStack) : Exception(make_message(port, protocol, msg), cause, location, skipStack + 1), _port(port), _protocol(protocol) @@ -104,15 +104,15 @@ PortListenException::~PortListenException() {} //----------------------------------------------------------------------------- -IoException::IoException(const stringref & msg, Type type, - const stringref & location, int skipStack) +IoException::IoException(stringref msg, Type type, + stringref location, int skipStack) : Exception(createMessage(msg, type), location, skipStack+1), _type(type) { } -IoException::IoException(const stringref & msg, Type type, - const Exception& cause, const stringref & location, +IoException::IoException(stringref msg, Type type, + const Exception& cause, stringref location, int skipStack) : Exception(createMessage(msg, type), cause, location, skipStack+1), _type(type) @@ -120,7 +120,7 @@ IoException::IoException(const stringref & msg, Type type, } string -IoException::createMessage(const stringref & msg, Type type) +IoException::createMessage(stringref msg, Type type) { vespalib::asciistream ost; switch (type) { diff --git a/vespalib/src/vespa/vespalib/util/exceptions.h b/vespalib/src/vespa/vespalib/util/exceptions.h index 4349aaa8d78..452781b1afc 100644 --- a/vespalib/src/vespa/vespalib/util/exceptions.h +++ b/vespalib/src/vespa/vespalib/util/exceptions.h @@ -97,17 +97,13 @@ private: int _port; vespalib::string _protocol; - vespalib::string make_message(int port, const vespalib::stringref &protocol, - const vespalib::stringref &msg); + vespalib::string make_message(int port, vespalib::stringref protocol, vespalib::stringref msg); public: - PortListenException(int port, const vespalib::stringref &protocol, - const vespalib::stringref &msg = "", - const vespalib::stringref &location = "", int skipStack = 0); - PortListenException(int port, const vespalib::stringref &protocol, - const Exception &cause, - const vespalib::stringref &msg = "", - const vespalib::stringref &location = "", int skipStack = 0); + PortListenException(int port, vespalib::stringref protocol, vespalib::stringref msg = "", + vespalib::stringref location = "", int skipStack = 0); + PortListenException(int port, vespalib::stringref protocol, const Exception &cause, vespalib::stringref msg = "", + vespalib::stringref location = "", int skipStack = 0); PortListenException(PortListenException &&) = default; PortListenException & operator = (PortListenException &&) = default; PortListenException(const PortListenException &); @@ -131,14 +127,12 @@ public: TOO_MANY_OPEN_FILES, DIRECTORY_HAVE_CONTENT, FILE_FULL, ALREADY_EXISTS }; - IoException(const stringref & msg, Type type, const stringref & location, - int skipStack = 0); - IoException(const stringref & msg, Type type, const Exception& cause, - const stringref & location, int skipStack = 0); + IoException(stringref msg, Type type, stringref location, int skipStack = 0); + IoException(stringref msg, Type type, const Exception& cause, stringref location, int skipStack = 0); VESPA_DEFINE_EXCEPTION_SPINE(IoException); - static string createMessage(const stringref & msg, Type type); + static string createMessage(stringref msg, Type type); Type getType() const { return _type; } diff --git a/vespalib/src/vespa/vespalib/util/regexp.cpp b/vespalib/src/vespa/vespalib/util/regexp.cpp index 7a400d1ca35..85079383c8c 100644 --- a/vespalib/src/vespa/vespalib/util/regexp.cpp +++ b/vespalib/src/vespa/vespalib/util/regexp.cpp @@ -64,7 +64,7 @@ Regexp::match(vespalib::stringref s) const return pos >= 0; } -vespalib::string Regexp::replace(vespalib::stringref s, const vespalib::stringref & replacement) const +vespalib::string Regexp::replace(vespalib::stringref s, vespalib::stringref replacement) const { if ( ! valid() ) { return s; } regex_t *preg = const_cast<regex_t *>(static_cast<const regex_t *>(_data)); diff --git a/vespalib/src/vespa/vespalib/util/regexp.h b/vespalib/src/vespa/vespalib/util/regexp.h index 42dbf3872ad..c9500b39099 100644 --- a/vespalib/src/vespa/vespalib/util/regexp.h +++ b/vespalib/src/vespa/vespalib/util/regexp.h @@ -63,7 +63,7 @@ public: * @param replacement text to replace the pattern. * @return modified string. **/ - vespalib::string replace(vespalib::stringref s, const vespalib::stringref & replacement) const; + vespalib::string replace(vespalib::stringref s, vespalib::stringref replacement) const; /** * Look at the given regular expression and identify the prefix |