diff --git a/pdns/communicator.hh b/pdns/communicator.hh index 768b8dee716d..4fba795a5084 100644 --- a/pdns/communicator.hh +++ b/pdns/communicator.hh @@ -29,6 +29,7 @@ #include #include #include +#include using namespace boost::multi_index; #include @@ -234,8 +235,8 @@ private: struct RemoveSentinel { - explicit RemoveSentinel(const DNSName& dn, CommunicatorClass* cc) : - d_dn(dn), d_cc(cc) + explicit RemoveSentinel(DNSName dn, CommunicatorClass* cc) : + d_dn(std::move(dn)), d_cc(cc) {} ~RemoveSentinel() diff --git a/pdns/dnsbackend.hh b/pdns/dnsbackend.hh index 7b7e4c211784..07e99388ae04 100644 --- a/pdns/dnsbackend.hh +++ b/pdns/dnsbackend.hh @@ -479,8 +479,8 @@ private: class BackendFactory { public: - BackendFactory(const string& name) : - d_name(name) {} + BackendFactory(string name) : + d_name(std::move(name)) {} virtual ~BackendFactory() = default; virtual DNSBackend* make(const string& suffix) = 0; virtual DNSBackend* makeMetadataOnly(const string& suffix) diff --git a/pdns/dnsname.hh b/pdns/dnsname.hh index ccf8eb004de6..398c27c9d315 100644 --- a/pdns/dnsname.hh +++ b/pdns/dnsname.hh @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -306,7 +307,8 @@ extern const DNSName g_rootdnsname, g_wildcarddnsname; template struct SuffixMatchTree { - SuffixMatchTree(const std::string& name="", bool endNode_=false) : d_name(name), endNode(endNode_) + SuffixMatchTree(std::string name = "", bool endNode_ = false) : + d_name(std::move(name)), endNode(endNode_) {} SuffixMatchTree(const SuffixMatchTree& rhs): d_name(rhs.d_name), children(rhs.children), endNode(rhs.endNode) diff --git a/pdns/dnsrecords.hh b/pdns/dnsrecords.hh index 1913bfa50198..7bddcc2b6d6f 100644 --- a/pdns/dnsrecords.hh +++ b/pdns/dnsrecords.hh @@ -30,6 +30,7 @@ #include "rcpgenerator.hh" #include #include +#include #include "namespaces.hh" #include "iputils.hh" #include "svc-records.hh" @@ -289,8 +290,8 @@ private: class NSRecordContent : public DNSRecordContent { public: - includeboilerplate(NS) - explicit NSRecordContent(const DNSName& content) : d_content(content){} + includeboilerplate(NS) explicit NSRecordContent(DNSName content) : + d_content(std::move(content)) {} const DNSName& getNS() const { return d_content; } bool operator==(const DNSRecordContent& rhs) const override { @@ -310,8 +311,8 @@ private: class PTRRecordContent : public DNSRecordContent { public: - includeboilerplate(PTR) - explicit PTRRecordContent(const DNSName& content) : d_content(content){} + includeboilerplate(PTR) explicit PTRRecordContent(DNSName content) : + d_content(std::move(content)) {} const DNSName& getContent() const { return d_content; } [[nodiscard]] size_t sizeEstimate() const override { @@ -325,7 +326,8 @@ class CNAMERecordContent : public DNSRecordContent { public: includeboilerplate(CNAME) - CNAMERecordContent(const DNSName& content) : d_content(content){} + CNAMERecordContent(DNSName content) : + d_content(std::move(content)) {} DNSName getTarget() const { return d_content; } [[nodiscard]] size_t sizeEstimate() const override { @@ -358,7 +360,8 @@ class DNAMERecordContent : public DNSRecordContent { public: includeboilerplate(DNAME) - DNAMERecordContent(const DNSName& content) : d_content(content){} + DNAMERecordContent(DNSName content) : + d_content(std::move(content)) {} const DNSName& getTarget() const { return d_content; } [[nodiscard]] size_t sizeEstimate() const override { diff --git a/pdns/lua-base4.hh b/pdns/lua-base4.hh index 1786d0ff78cc..884921817b5d 100644 --- a/pdns/lua-base4.hh +++ b/pdns/lua-base4.hh @@ -1,6 +1,7 @@ #pragma once #include "namespaces.hh" #include +#include #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -13,7 +14,8 @@ protected: std::string d_include_path; // path where scripts to include at postLoad are public: - BaseLua4(const std::string &includePath) : d_include_path(includePath) {}; + BaseLua4(std::string includePath) : + d_include_path(std::move(includePath)) {}; void loadFile(const std::string &fname, bool doPostLoad=true); void loadString(const std::string &script); void loadStream(std::istream &stream, bool doPostLoad=true); diff --git a/pdns/misc.hh b/pdns/misc.hh index 66dd0ccf3e33..1082b47c5ad6 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -39,6 +39,7 @@ #include #include #include +#include #include #include "namespaces.hh" @@ -528,7 +529,8 @@ private: class SimpleMatch { public: - SimpleMatch(const string &mask, bool caseFold = false): d_mask(mask), d_fold(caseFold) + SimpleMatch(string mask, bool caseFold = false) : + d_mask(std::move(mask)), d_fold(caseFold) { } diff --git a/pdns/pdnsexception.hh b/pdns/pdnsexception.hh index 8960816b709f..3417fe177bd4 100644 --- a/pdns/pdnsexception.hh +++ b/pdns/pdnsexception.hh @@ -21,6 +21,7 @@ */ #pragma once #include +#include #include "namespaces.hh" @@ -29,8 +30,9 @@ class PDNSException { public: PDNSException() : reason("Unspecified") {}; - PDNSException(const string& r) : reason(r) {}; - + PDNSException(string r) : + reason(std::move(r)) {}; + string reason; //! Print this to tell the user what went wrong }; diff --git a/pdns/webserver.hh b/pdns/webserver.hh index 8d5c42e75e16..e1f3795f6912 100644 --- a/pdns/webserver.hh +++ b/pdns/webserver.hh @@ -26,6 +26,7 @@ #include #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Woverloaded-virtual" +#include #include #pragma GCC diagnostic pop @@ -38,7 +39,8 @@ class HttpRequest : public YaHTTP::Request { public: - HttpRequest(const string& logprefix_="") : YaHTTP::Request(), logprefix(logprefix_) { }; + HttpRequest(string logprefix_ = "") : + YaHTTP::Request(), logprefix(std::move(logprefix_)) {}; string logprefix; bool accept_yaml{false};