From fa6df14c2360f2b55daac0744e8a675eaf3e5eb4 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 5 Aug 2026 13:48:02 +0200 Subject: [PATCH] refactor: uint256::operator==() = default This is standard C++20, and may allow a compiler to optimize a bit more. --- src/uint256.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uint256.h b/src/uint256.h index 1419fd79855..00db02d058a 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -59,6 +59,8 @@ public: std::fill(m_data.begin(), m_data.end(), 0); } + constexpr bool operator==(const base_blob&) const = default; + /** Lexicographic ordering * @note Does NOT match the ordering on the corresponding \ref * base_uint::CompareTo, which starts comparing from the end. @@ -70,7 +72,6 @@ public: return 0; } - friend constexpr bool operator==(const base_blob& a, const base_blob& b) { return a.Compare(b) == 0; } friend constexpr bool operator<(const base_blob& a, const base_blob& b) { return a.Compare(b) < 0; } /** @name Hex representation