From d48a1b80a125998f8798b4ff262ccce4709eae23 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 20 Jan 2025 09:41:38 +0100 Subject: [PATCH] rec: Coverity issues missed in last round, all severity "Low" 1587809 Variable copied when it could be moved 1587817 Variable copied when it could be moved 1587819 Variable copied when it could be moved --- pdns/recursordist/rec-zonetocache.cc | 2 +- pdns/recursordist/syncres.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pdns/recursordist/rec-zonetocache.cc b/pdns/recursordist/rec-zonetocache.cc index 4833f8ac7c..d4f71f14d1 100644 --- a/pdns/recursordist/rec-zonetocache.cc +++ b/pdns/recursordist/rec-zonetocache.cc @@ -106,7 +106,7 @@ void ZoneData::parseDRForCache(DNSRecord& dnsRecord) const auto sigkey = pair(key.first, rrsig->d_type); auto found = d_sigs.find(sigkey); if (found != d_sigs.end()) { - found->second.push_back(rrsig); + found->second.push_back(std::move(rrsig)); } else { vector> sigsrr; diff --git a/pdns/recursordist/syncres.cc b/pdns/recursordist/syncres.cc index f19e458539..3e4f5a941d 100644 --- a/pdns/recursordist/syncres.cc +++ b/pdns/recursordist/syncres.cc @@ -1049,7 +1049,7 @@ int SyncRes::AuthDomain::getRecords(const DNSName& qname, const QType qtype, std for (ziter = range.first; ziter != range.second; ++ziter) { DNSRecord dnsRecord = *ziter; dnsRecord.d_place = DNSResourceRecord::AUTHORITY; - records.push_back(dnsRecord); + records.push_back(std::move(dnsRecord)); } } @@ -3105,7 +3105,7 @@ bool SyncRes::doCacheCheck(const DNSName& qname, const DNSName& authname, bool w for (const auto& rec : *authorityRecs) { DNSRecord dnsRecord(rec); dnsRecord.d_ttl = ttl; - ret.push_back(dnsRecord); + ret.push_back(std::move(dnsRecord)); } LOG(endl); -- 2.47.2