]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Pass strings as const references in exceptions
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 29 Jan 2021 15:56:03 +0000 (16:56 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 29 Jan 2021 15:56:03 +0000 (16:56 +0100)
ext/luawrapper/include/LuaContext.hpp
pdns/pdnsexception.hh

index 5017cd7b847b556cef0bdfab62a59f877b5be52d..fa2ff91bf29d5298dd87615a45898cc09749ea35 100644 (file)
@@ -204,7 +204,7 @@ public:
     class WrongTypeException : public std::runtime_error
     {
     public:
-        WrongTypeException(std::string luaType_, const std::type_info& destination_) :
+        WrongTypeException(const std::string& luaType_, const std::type_info& destination_) :
             std::runtime_error("Trying to cast a lua variable from \"" + luaType_ + "\" to \"" + destination_.name() + "\""),
             luaType(luaType_),
             destination(destination_)
index 67fce0adcec62839f2b48c05215b39aacc2fd7fa..8960816b709f189f9dbd7fd5a6d5b544188e9b3e 100644 (file)
@@ -29,7 +29,7 @@ class PDNSException
 {
 public:
   PDNSException() : reason("Unspecified") {};
-  PDNSException(string r) : reason(r) {};
+  PDNSException(const string& r) : reason(r) {};
   
   string reason; //! Print this to tell the user what went wrong
 };
@@ -38,5 +38,5 @@ class TimeoutException : public PDNSException
 {
 public:
   TimeoutException() : PDNSException() {}
-  TimeoutException(string r) : PDNSException(r) {}
+  TimeoutException(const string& r) : PDNSException(r) {}
 };