From: Miod Vallat Date: Thu, 7 May 2026 10:28:08 +0000 (+0200) Subject: Simplify the second loop even further, no need to rebuild the container. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d201bf508e95997f36cf69c503fc5042ac877be1;p=thirdparty%2Fpdns.git Simplify the second loop even further, no need to rebuild the container. Signed-off-by: Miod Vallat --- diff --git a/pdns/dbdnsseckeeper.cc b/pdns/dbdnsseckeeper.cc index ae2ada42e3..4717989754 100644 --- a/pdns/dbdnsseckeeper.cc +++ b/pdns/dbdnsseckeeper.cc @@ -764,7 +764,6 @@ bool DNSSECKeeper::rectifyZone(const ZoneName& zone, string& error, string& info ostringstream infostream; DNSResourceRecord rr; set qnames, nsset, dsnames, insnonterm, delnonterm; - std::unordered_map nonterm; vector rrs; std::unordered_map rss; @@ -861,6 +860,7 @@ bool DNSSECKeeper::rectifyZone(const ZoneName& zone, string& error, string& info try { sd.db->rectifyZoneHook(sd.domain_id, true); + std::unordered_map nonterm; bool doent{true}; uint32_t maxent = ::arg().asNum("max-ent-entries"); @@ -945,20 +945,12 @@ bool DNSSECKeeper::rectifyZone(const ZoneName& zone, string& error, string& info if (!insnonterm.empty() || !delnonterm.empty() || !doent) { sd.db->updateEmptyNonTerminals(sd.domain_id, insnonterm, delnonterm, !doent); } - if (doent) { - qnames.clear(); - for(const auto& nt : nonterm) { - qnames.insert(nt.first); - } - } + qnames.clear(); if (doent) { - for (const auto& qname: qnames) { - bool auth{true}; + for (const auto& nt : nonterm) { // NOLINT(readability-identifier-length) + auto [qname, auth] = nt; DNSName ordername; - auto shorter(qname); - - auth = nonterm.find(qname)->second; if (haveNSEC3) { // NSEC3 if (nsec3set.count(qname) != 0) {