]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
clang-tidy: use const ref in range loops
authorRosen Penev <rosenp@gmail.com>
Sat, 10 Feb 2024 00:59:21 +0000 (16:59 -0800)
committerRosen Penev <rosenp@gmail.com>
Wed, 5 Jun 2024 02:04:10 +0000 (19:04 -0700)
Signed-off-by: Rosen Penev <rosenp@gmail.com>
modules/geoipbackend/geoipbackend.cc

index 5d06d2f6cc4401b2fc319f3203f683b9aba50d4d..ca0ca187209b640fcdbf105f37069606404cdeea 100644 (file)
@@ -895,7 +895,7 @@ bool GeoIPBackend::getDomainInfo(const DNSName& domain, DomainInfo& di, bool /*
 {
   ReadLock rl(&s_state_lock);
 
-  for (GeoIPDomain dom : s_domains) {
+  for (const GeoIPDomain& dom : s_domains) {
     if (dom.domain == domain) {
       SOAData sd;
       this->getSOA(domain, sd);
@@ -933,7 +933,7 @@ bool GeoIPBackend::getAllDomainMetadata(const DNSName& name, std::map<std::strin
     return false;
 
   ReadLock rl(&s_state_lock);
-  for (GeoIPDomain dom : s_domains) {
+  for (const GeoIPDomain& dom : s_domains) {
     if (dom.domain == name) {
       if (hasDNSSECkey(dom.domain)) {
         meta[string("NSEC3NARROW")].push_back("1");
@@ -951,7 +951,7 @@ bool GeoIPBackend::getDomainMetadata(const DNSName& name, const std::string& kin
     return false;
 
   ReadLock rl(&s_state_lock);
-  for (GeoIPDomain dom : s_domains) {
+  for (const GeoIPDomain& dom : s_domains) {
     if (dom.domain == name) {
       if (hasDNSSECkey(dom.domain)) {
         if (kind == "NSEC3NARROW")
@@ -970,7 +970,7 @@ bool GeoIPBackend::getDomainKeys(const DNSName& name, std::vector<DNSBackend::Ke
   if (!d_dnssec)
     return false;
   ReadLock rl(&s_state_lock);
-  for (GeoIPDomain dom : s_domains) {
+  for (const GeoIPDomain& dom : s_domains) {
     if (dom.domain == name) {
       regex_t reg;
       regmatch_t regm[5];
@@ -1016,7 +1016,7 @@ bool GeoIPBackend::removeDomainKey(const DNSName& name, unsigned int id)
   WriteLock rl(&s_state_lock);
   ostringstream path;
 
-  for (GeoIPDomain dom : s_domains) {
+  for (const GeoIPDomain& dom : s_domains) {
     if (dom.domain == name) {
       regex_t reg;
       regmatch_t regm[5];
@@ -1052,7 +1052,7 @@ bool GeoIPBackend::addDomainKey(const DNSName& name, const KeyData& key, int64_t
   WriteLock rl(&s_state_lock);
   unsigned int nextid = 1;
 
-  for (GeoIPDomain dom : s_domains) {
+  for (const GeoIPDomain& dom : s_domains) {
     if (dom.domain == name) {
       regex_t reg;
       regmatch_t regm[5];
@@ -1088,7 +1088,7 @@ bool GeoIPBackend::activateDomainKey(const DNSName& name, unsigned int id)
   if (!d_dnssec)
     return false;
   WriteLock rl(&s_state_lock);
-  for (GeoIPDomain dom : s_domains) {
+  for (const GeoIPDomain& dom : s_domains) {
     if (dom.domain == name) {
       regex_t reg;
       regmatch_t regm[5];
@@ -1123,7 +1123,7 @@ bool GeoIPBackend::deactivateDomainKey(const DNSName& name, unsigned int id)
   if (!d_dnssec)
     return false;
   WriteLock rl(&s_state_lock);
-  for (GeoIPDomain dom : s_domains) {
+  for (const GeoIPDomain& dom : s_domains) {
     if (dom.domain == name) {
       regex_t reg;
       regmatch_t regm[5];