From: Remi Gacogne Date: Fri, 18 Nov 2022 15:57:09 +0000 (+0100) Subject: dnsdist: Prevent a copy when inserting a tag X-Git-Tag: dnsdist-1.8.0-rc1~196^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c878adc15091d0b0ed36d85f6ed4baa4c2f0edd;p=thirdparty%2Fpdns.git dnsdist: Prevent a copy when inserting a tag --- diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index 698aee212e..b7c7e63ee9 100644 --- a/pdns/dnsdist.hh +++ b/pdns/dnsdist.hh @@ -121,11 +121,11 @@ struct DNSQuestion return !(protocol == dnsdist::Protocol::DoUDP || protocol == dnsdist::Protocol::DNSCryptUDP); } - void setTag(const std::string& key, std::string&& value) { + void setTag(std::string&& key, std::string&& value) { if (!qTag) { qTag = std::make_unique(); } - qTag->insert_or_assign(key, std::move(value)); + qTag->insert_or_assign(std::move(key), std::move(value)); } void setTag(const std::string& key, const std::string& value) {