]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: Small cleanup in SimpleMatch 10310/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 19 Apr 2021 10:28:55 +0000 (12:28 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 19 Apr 2021 10:28:55 +0000 (12:28 +0200)
pdns/misc.hh

index 38f06bc1b596e17f73cce42fc2b2e2cdb4fc2a10..9b19924292df17328315244306a7745db915bf34 100644 (file)
@@ -489,7 +489,7 @@ public:
   {
   }
  
-  bool match(string::const_iterator mi, string::const_iterator mend, string::const_iterator vi, string::const_iterator vend)
+  bool match(string::const_iterator mi, string::const_iterator mend, string::const_iterator vi, string::const_iterator vend) const
   {
     for(;;++mi) {
       if (mi == mend) {
@@ -499,7 +499,7 @@ public:
         ++vi;
       } else if (*mi == '*') {
         while(mi != mend && *mi == '*') ++mi;
-        if (mi == d_mask.end()) return true;
+        if (mi == mend) return true;
         while(vi != vend) {
           if (match(mi,mend,vi,vend)) return true;
           ++vi;
@@ -518,17 +518,17 @@ public:
     }
   }
 
-  bool match(const string& value) {
+  bool match(const string& value) const {
     return match(d_mask.begin(), d_mask.end(), value.begin(), value.end());
   }
 
-  bool match(const DNSName& name) {
+  bool match(const DNSName& name) const {
     return match(name.toStringNoDot());
   }
 
 private:
-  string d_mask;
-  bool d_fold;
+  const string d_mask;
+  const bool d_fold;
 };
 
 union ComboAddress;