From 4a29f91d7c7ee244c03dc47895df7f05fc077f5c Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Mon, 13 Jul 2026 21:40:48 -0400 Subject: [PATCH] fixup! fixup! Address AI review feedback: tautological assert, typo in comment --- src/libxrpl/basics/Number.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libxrpl/basics/Number.cpp b/src/libxrpl/basics/Number.cpp index 3bbaf95011..1f2c41809a 100644 --- a/src/libxrpl/basics/Number.cpp +++ b/src/libxrpl/basics/Number.cpp @@ -353,6 +353,7 @@ Number::Guard::isNegative() const noexcept inline void Number::Guard::doPush(unsigned d) noexcept { + XRPL_ASSERT(d < 10, "xrpl::Number::Guard::doPush : valid digit"); xbit_ = xbit_ || ((digits_ & 0x0000'0000'0000'000F) != 0); digits_ >>= 4; digits_ |= (d & 0x0000'0000'0000'000FULL) << 60; @@ -449,9 +450,9 @@ Number::Guard::pushOverflow(T mantissa) // * For round toward zero, always rounds down to kMaxRep. auto const diff = mantissa - kMaxRep; - unsigned const digit = (diff * 10) / spread; + auto const digit = static_cast((diff * 10) / spread); XRPL_ASSERT( - digit < 10 && digit != 5, "xrpl::Number::Guard::pushOverflow : valid overflow digit"); + digit < 10u && 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);