From: Remi Gacogne Date: Mon, 19 Apr 2021 10:28:55 +0000 (+0200) Subject: auth: Small cleanup in SimpleMatch X-Git-Tag: dnsdist-1.6.0-rc2~11^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10310%2Fhead;p=thirdparty%2Fpdns.git auth: Small cleanup in SimpleMatch --- diff --git a/pdns/misc.hh b/pdns/misc.hh index 38f06bc1b5..9b19924292 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -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;