]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Fix a few Coverity found issues, all low severity move optimizations 16308/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 20 Oct 2025 09:01:18 +0000 (11:01 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 21 Oct 2025 07:49:20 +0000 (09:49 +0200)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/protozero-trace.hh
pdns/rcpgenerator.cc
pdns/recursordist/lwres.cc
pdns/recursordist/rec_channel_rec.cc

index 9dfed07861c7325dc0f3821d7ada5ce3aa1c174c..d739c26a82c5d3385925d4996fade2bd872dc6f4 100644 (file)
@@ -740,7 +740,7 @@ struct TracesData
     InstrumentationScope scope{
       .name = "rec", .version = VERSION, .attributes = {{"hostname", {hostname}}, {"server.id", {serverID}}}};
     return TracesData{
-      .resource_spans = {pdns::trace::ResourceSpans{.resource = {.attributes = {{"service.name", {{std::move(service)}}}}}, .scope_spans = {{.scope = scope, .spans = std::move(spans)}}}}};
+      .resource_spans = {pdns::trace::ResourceSpans{.resource = {.attributes = {{"service.name", {{std::move(service)}}}}}, .scope_spans = {{.scope = std::move(scope), .spans = std::move(spans)}}}}};
   }
 };
 
index 7bbbd62e232178655f9b3c3e3fa79da980d00cf4..f3e930b8cdfe46b427e398edb02f3b0fa60ea5b2 100644 (file)
@@ -1044,7 +1044,7 @@ void RecordTextWriter::xfrSvcParamKeyVals(const set<SvcParam>& val) {
         str += std::to_string(group);
         first = false;
       }
-      d_string = str;
+      d_string = std::move(str);
       break;
     }
     case SvcParam::dohpath:
index 82ed0d12e961e82167fca23474e174161033da5c..6171aca9ab901e36c519ca6ebe8748f9c0d78d7e 100644 (file)
@@ -424,7 +424,7 @@ static bool tcpconnect(const OptLog& log, const ComboAddress& remote, const std:
     }
     else {
       if (subjectName.empty() && !subjectAddress.empty()) {
-        subjectName = subjectAddress;
+        subjectName = std::move(subjectAddress);
         subjectIsAddress = true;
       }
       if (subjectName.empty()) {
index d87f0ba327955fb3ee9caeb3026e5c9f56fff0de..c9dcc86836af1cf551f79b6e5253798a19385e25 100644 (file)
@@ -616,7 +616,7 @@ static Answer doSetCarbonServer(ArgIterator begin, ArgIterator end)
   }
 
   g_carbonConfig.setState(std::move(config));
-  return {0, ret};
+  return {0, std::move(ret)};
 }
 
 static Answer doSetDnssecLogBogus(ArgIterator begin, ArgIterator end)