From f1bb4ded21ca2f9e430b9a661fbe630c4410109b 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 ffb991a41d..8043a850a8 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 a68dcd3286..24cf5d6967 100644 --- a/src/test/basics/Number_test.cpp +++ b/src/test/basics/Number_test.cpp @@ -1698,7 +1698,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; @@ -1930,9 +1930,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; {