From cc24a2133f1c2f0c1bcb1a618c1d80b53bdb5282 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 20 Oct 2025 11:01:18 +0200 Subject: [PATCH] rec: Fix a few Coverity found issues, all low severity move optimizations Signed-off-by: Otto Moerbeek --- pdns/protozero-trace.hh | 2 +- pdns/rcpgenerator.cc | 2 +- pdns/recursordist/lwres.cc | 2 +- pdns/recursordist/rec_channel_rec.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pdns/protozero-trace.hh b/pdns/protozero-trace.hh index 9dfed07861..d739c26a82 100644 --- a/pdns/protozero-trace.hh +++ b/pdns/protozero-trace.hh @@ -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)}}}}}; } }; diff --git a/pdns/rcpgenerator.cc b/pdns/rcpgenerator.cc index 7bbbd62e23..f3e930b8cd 100644 --- a/pdns/rcpgenerator.cc +++ b/pdns/rcpgenerator.cc @@ -1044,7 +1044,7 @@ void RecordTextWriter::xfrSvcParamKeyVals(const set& val) { str += std::to_string(group); first = false; } - d_string = str; + d_string = std::move(str); break; } case SvcParam::dohpath: diff --git a/pdns/recursordist/lwres.cc b/pdns/recursordist/lwres.cc index 82ed0d12e9..6171aca9ab 100644 --- a/pdns/recursordist/lwres.cc +++ b/pdns/recursordist/lwres.cc @@ -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()) { diff --git a/pdns/recursordist/rec_channel_rec.cc b/pdns/recursordist/rec_channel_rec.cc index d87f0ba327..c9dcc86836 100644 --- a/pdns/recursordist/rec_channel_rec.cc +++ b/pdns/recursordist/rec_channel_rec.cc @@ -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) -- 2.47.3