From fa6e1a1e85e2e3ee6ec8fedfb5ee27f1b5bf13c4 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 30 Jul 2026 19:52:01 +0200 Subject: [PATCH] refactor: Remove static from constexpr functions in headers Those functions have no need to be static in every TU. Also, static somewhat contradicts and overwrites the inline keyword. So remove the static, and just keep constexpr (which implies inline). --- src/net_permissions.h | 2 +- src/util/string.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net_permissions.h b/src/net_permissions.h index fbaa8f1d4ca..dd4d29513e9 100644 --- a/src/net_permissions.h +++ b/src/net_permissions.h @@ -46,7 +46,7 @@ enum class NetPermissionFlags : uint32_t { Implicit = (1U << 31), All = BloomFilter | ForceRelay | Relay | NoBan | Mempool | Download | Addr, }; -static inline constexpr NetPermissionFlags operator|(NetPermissionFlags a, NetPermissionFlags b) +constexpr NetPermissionFlags operator|(NetPermissionFlags a, NetPermissionFlags b) { using t = std::underlying_type_t; return static_cast(static_cast(a) | static_cast(b)); diff --git a/src/util/string.h b/src/util/string.h index d60fff0432c..218d9928786 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -23,7 +23,7 @@ namespace util { namespace detail { template -constexpr static void CheckNumFormatSpecifiers(const char* str) +constexpr void CheckNumFormatSpecifiers(const char* str) { unsigned count_normal{0}; // Number of "normal" specifiers, like %s unsigned count_pos{0}; // Max number in positional specifier, like %8$s