From: Miod Vallat Date: Thu, 26 Jun 2025 06:32:08 +0000 (+0200) Subject: de-inline DNSName::canonCompare(). NFC X-Git-Tag: rec-5.3.0-alpha2~40^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bbcb0cafa0fed1e97133f6b9c68db3b78d98b03f;p=thirdparty%2Fpdns.git de-inline DNSName::canonCompare(). NFC Signed-off-by: Miod Vallat --- diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index 13c5cdb19e..04ba589c7e 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -468,6 +468,60 @@ bool DNSName::slowCanonCompare(const DNSName& rhs) const return std::lexicographical_compare(ours.rbegin(), ours.rend(), rhsLabels.rbegin(), rhsLabels.rend(), CIStringCompare()); } +bool DNSName::canonCompare(const DNSName& rhs) const +{ + // 01234567890abcd + // us: 1a3www4ds9a2nl + // rhs: 3www6online3com + // to compare, we start at the back, is nl < com? no -> done + // + // 0,2,6,a + // 0,4,a + + uint8_t ourpos[64], rhspos[64]; + uint8_t ourcount=0, rhscount=0; + //cout<<"Asked to compare "< DNSName::getRawLabels() const { vector ret; diff --git a/pdns/dnsname.hh b/pdns/dnsname.hh index 07ed9e59f7..3c44a6c8db 100644 --- a/pdns/dnsname.hh +++ b/pdns/dnsname.hh @@ -189,7 +189,7 @@ public: DNSNameCompare()); } - inline bool canonCompare(const DNSName& rhs) const; + bool canonCompare(const DNSName& rhs) const; bool slowCanonCompare(const DNSName& rhs) const; typedef boost::container::string string_t; @@ -253,60 +253,6 @@ private: size_t hash_value(DNSName const& d); -inline bool DNSName::canonCompare(const DNSName& rhs) const -{ - // 01234567890abcd - // us: 1a3www4ds9a2nl - // rhs: 3www6online3com - // to compare, we start at the back, is nl < com? no -> done - // - // 0,2,6,a - // 0,4,a - - uint8_t ourpos[64], rhspos[64]; - uint8_t ourcount=0, rhscount=0; - //cout<<"Asked to compare "<