From bbcb0cafa0fed1e97133f6b9c68db3b78d98b03f Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Thu, 26 Jun 2025 08:32:08 +0200 Subject: [PATCH] de-inline DNSName::canonCompare(). NFC Signed-off-by: Miod Vallat --- pdns/dnsname.cc | 54 +++++++++++++++++++++++++++++++++++++++++++++++ pdns/dnsname.hh | 56 +------------------------------------------------ 2 files changed, 55 insertions(+), 55 deletions(-) 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 "<