From f19ecb3b80ee4cdc3e06655c9d585cabe926acee Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Thu, 5 Feb 2026 19:56:18 -0500 Subject: [PATCH] fixup! fixup! fixup! Address review feedback from @copilot --- include/xrpl/basics/Number.h | 9 ++++----- src/libxrpl/basics/Number.cpp | 11 ++++------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/xrpl/basics/Number.h b/include/xrpl/basics/Number.h index c9b0cb2b3d..e0500fad57 100644 --- a/include/xrpl/basics/Number.h +++ b/include/xrpl/basics/Number.h @@ -625,10 +625,10 @@ private: /** Rebuilds the number from components. * - * If "normalized" is true, the values are expected to be normalized - all + * If "expectNormal" is true, the values are expected to be normalized - all * in their valid ranges. * - * If "normalized" is false, the values are expected to be "near + * If "expectNormal" is false, the values are expected to be "near * normalized", meaning that the mantissa has to be modified at most once to * bring it back into range. * @@ -639,10 +639,10 @@ private: /** Rebuilds the number from components. * - * If "normalized" is true, the values are expected to be normalized - all + * If "expectNormal" is true, the values are expected to be normalized - all * in their valid ranges. * - * If "normalized" is false, the values are expected to be "near + * If "expectNormal" is false, the values are expected to be "near * normalized", meaning that the mantissa has to be modified at most once to * bring it back into range. * @@ -827,7 +827,6 @@ std::pair Number::normalizeToRange(T minMantissa, T maxMantissa) const { bool negative = mantissa_ < 0; - auto const sign = negative ? -1 : 1; internalrep mantissa = externalToInternal(mantissa_); int exponent = exponent_; diff --git a/src/libxrpl/basics/Number.cpp b/src/libxrpl/basics/Number.cpp index a4600d52e2..c13a4046c3 100644 --- a/src/libxrpl/basics/Number.cpp +++ b/src/libxrpl/basics/Number.cpp @@ -323,7 +323,6 @@ Number::toInternal(MantissaRange const& range) const { auto exponent = exponent_; bool const negative = mantissa_ < 0; - auto const sign = negative ? -1 : 1; // It should be impossible for mantissa_ to be INT64_MIN, but use externalToInternal just in case. Rep mantissa = static_cast(externalToInternal(mantissa_)); @@ -358,10 +357,10 @@ Number::toInternal() const /** Rebuilds the number from components. * - * If "normalized" is true, the values are expected to be normalized - all + * If "expectNormal" is true, the values are expected to be normalized - all * in their valid ranges. * - * If "normalized" is false, the values are expected to be "near + * If "expectNormal" is false, the values are expected to be "near * normalized", meaning that the mantissa has to be modified at most once to * bring it back into range. * @@ -390,8 +389,6 @@ Number::fromInternal(bool negative, Rep mantissa, int exponent, MantissaRange co mantissa >= minMantissa && mantissa <= maxMantissa, "xrpl::Number::fromInternal", "mantissa in range"); } - auto const sign = negative ? -1 : 1; - // mantissa is unsigned, but it might not be uint64 mantissa_ = static_cast(static_cast(mantissa)); if (negative) @@ -404,10 +401,10 @@ Number::fromInternal(bool negative, Rep mantissa, int exponent, MantissaRange co /** Rebuilds the number from components. * - * If "normalized" is true, the values are expected to be normalized - all in + * If "expectNormal" is true, the values are expected to be normalized - all in * their valid ranges. * - * If "normalized" is false, the values are expected to be "near normalized", + * If "expectNormal" is false, the values are expected to be "near normalized", * meaning that the mantissa has to be modified at most once to bring it back * into range. *