From 7b2a91f5aaed329be9908d00b575f04079623829 Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Mon, 13 Jul 2026 17:24:52 -0400 Subject: [PATCH] Address AI review feedback: tautological assert, typo in comment --- src/libxrpl/basics/Number.cpp | 4 ++-- src/libxrpl/protocol/Rules.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libxrpl/basics/Number.cpp b/src/libxrpl/basics/Number.cpp index 4a9a5c9947..41516a9fe1 100644 --- a/src/libxrpl/basics/Number.cpp +++ b/src/libxrpl/basics/Number.cpp @@ -450,9 +450,9 @@ Number::Guard::pushOverflow(T mantissa) auto const diff = mantissa - kMaxRep; auto const digit = (diff * 10) / spread; + static_assert(std::unsigned_integral); XRPL_ASSERT( - digit >= 0 && digit < 10 && digit != 5, - "xrpl::Number::Guard::pushOverflow : valid overflow digit"); + digit < 10 && digit != 5, "xrpl::Number::Guard::pushOverflow : valid overflow digit"); // Don't remove the digit from the mantissa, but add it to the guard as if it was. push(digit); diff --git a/src/libxrpl/protocol/Rules.cpp b/src/libxrpl/protocol/Rules.cpp index d71bb77f66..197139027a 100644 --- a/src/libxrpl/protocol/Rules.cpp +++ b/src/libxrpl/protocol/Rules.cpp @@ -45,7 +45,7 @@ setCurrentTransactionRules(std::optional r) // amendments must also be added to useRulesGuards. bool const enableLargeNumbers = !r || (r->enabled(featureSingleAssetVault) || r->enabled(featureLendingProtocol)); - // If enableLargeNumbers is true, then useRulesGuard must also return true. + // If enableLargeNumbers is true, then useRulesGuards must also return true. // However, the reverse is not true. Other amendments can cause the rules guard to be used, // even though large numbers are _not_ used. XRPL_ASSERT(