From 0a240237972af2a23e62ff1f0c3d1c28c0325f93 Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Thu, 4 Jun 2026 20:05:53 -0400 Subject: [PATCH] clang-tidy: template param names, const correctness, braces --- include/xrpl/basics/Number.h | 10 +++++----- src/test/basics/Number_test.cpp | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/xrpl/basics/Number.h b/include/xrpl/basics/Number.h index fae65ecb35..d256bcbb2a 100644 --- a/include/xrpl/basics/Number.h +++ b/include/xrpl/basics/Number.h @@ -54,11 +54,11 @@ namespace detail { constexpr std::size_t kUint64Digits = 20; constexpr std::size_t kUint128Digits = 39; -template -consteval std::array +template +consteval std::array buildPowersOfTen() { - std::array result{}; + std::array result{}; T power = 1; std::size_t exponent = 0; @@ -78,8 +78,8 @@ buildPowersOfTen() } // namespace detail -template -constexpr std::array kPowerOfTenImpl = detail::buildPowersOfTen(); +template +constexpr std::array kPowerOfTenImpl = detail::buildPowersOfTen(); constexpr auto kPowerOfTen = kPowerOfTenImpl; diff --git a/src/test/basics/Number_test.cpp b/src/test/basics/Number_test.cpp index 0c33ab5aee..aa1de91b0c 100644 --- a/src/test/basics/Number_test.cpp +++ b/src/test/basics/Number_test.cpp @@ -1794,7 +1794,7 @@ public: BigInt const exactProduct = BigInt(kAValue) * BigInt(kBValue); // What Number actually stored. - BigInt storedValue = toBigInt(product); + BigInt const storedValue = toBigInt(product); BigInt const signedDifference = storedValue - exactProduct; @@ -2026,9 +2026,13 @@ public: BEAST_EXPECT(toBigInt(a) == BigInt{"100000000000000000000"}); if (scale != MantissaRange::MantissaScale::Small) + { BEAST_EXPECT(toBigInt(b) == BigInt{"-1000000000000000001"}); + } else + { BEAST_EXPECT(toBigInt(b) == BigInt{"-1000000000000000000"}); + } Number sum; {