]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Mark dns_{isspace,tolower,toupper} pure.
authorMiod Vallat <miod.vallat@powerdns.com>
Wed, 25 Jun 2025 17:01:16 +0000 (19:01 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Wed, 25 Jun 2025 17:03:51 +0000 (19:03 +0200)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
pdns/dnsname.hh

index 630e9be4d8511e791baf685bbe186d597586e30d..f9042b590aac94168e2e6280b3747accee502811 100644 (file)
@@ -39,21 +39,24 @@ using namespace std::string_view_literals;
 #include <boost/version.hpp>
 #include <boost/container/string.hpp>
 
-inline bool dns_isspace(char c)
+inline bool dns_isspace(char chr) __attribute__((pure));
+inline bool dns_isspace(char chr)
 {
-  return c == ' ' || c == '\t' || c == '\r' || c == '\n';
+  return chr == ' ' || chr == '\t' || chr == '\r' || chr == '\n';
 }
 
-extern const unsigned char dns_toupper_table[256],  dns_tolower_table[256];
+extern const unsigned char dns_toupper_table[256], dns_tolower_table[256];
 
-inline unsigned char dns_toupper(unsigned char c)
+inline unsigned char dns_toupper(unsigned char chr) __attribute__((pure));
+inline unsigned char dns_toupper(unsigned char chr)
 {
-  return dns_toupper_table[c];
+  return dns_toupper_table[chr];
 }
 
-inline unsigned char dns_tolower(unsigned char c)
+inline unsigned char dns_tolower(unsigned char chr) __attribute__((pure));
+inline unsigned char dns_tolower(unsigned char chr)
 {
-  return dns_tolower_table[c];
+  return dns_tolower_table[chr];
 }
 
 #include "burtle.hh"
@@ -243,7 +246,6 @@ private:
 
 size_t hash_value(DNSName const& d);
 
-
 inline bool DNSName::canonCompare(const DNSName& rhs) const
 {
   //      01234567890abcd