diff options
author | B0IIZZ <70597779+b0iizz@users.noreply.github.com> | 2022-01-01 22:21:19 +0100 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-01-04 06:01:22 +0000 |
commit | 6124050187b5bd11532829ce1ef7559cccca4143 (patch) | |
tree | b931a54bbebc85a596f1cb528f28a9cbb1b96564 /AK | |
parent | 143465b23afd1297c72c6258a3595ed9b104fa64 (diff) | |
download | serenity-6124050187b5bd11532829ce1ef7559cccca4143.zip |
AK: Fix UFixedBigInt comparison operators
Instead of using the specified type U like we want,
we were using the type T all along when comparing with
smaller integers. This is now fixed.
Diffstat (limited to 'AK')
-rw-r--r-- | AK/UFixedBigInt.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/AK/UFixedBigInt.h b/AK/UFixedBigInt.h index 52f02971d3..cc35324c8e 100644 --- a/AK/UFixedBigInt.h +++ b/AK/UFixedBigInt.h @@ -135,32 +135,32 @@ public: return m_low || m_high; } template<Unsigned U> - requires(sizeof(T) >= sizeof(U)) constexpr bool operator==(const T& other) const + requires(sizeof(T) >= sizeof(U)) constexpr bool operator==(const U& other) const { return !m_high && m_low == other; } template<Unsigned U> - requires(sizeof(T) >= sizeof(U)) constexpr bool operator!=(const T& other) const + requires(sizeof(T) >= sizeof(U)) constexpr bool operator!=(const U& other) const { return m_high || m_low != other; } template<Unsigned U> - requires(sizeof(T) >= sizeof(U)) constexpr bool operator>(const T& other) const + requires(sizeof(T) >= sizeof(U)) constexpr bool operator>(const U& other) const { return m_high || m_low > other; } template<Unsigned U> - requires(sizeof(T) >= sizeof(U)) constexpr bool operator<(const T& other) const + requires(sizeof(T) >= sizeof(U)) constexpr bool operator<(const U& other) const { return !m_high && m_low < other; } template<Unsigned U> - requires(sizeof(T) >= sizeof(U)) constexpr bool operator>=(const T& other) const + requires(sizeof(T) >= sizeof(U)) constexpr bool operator>=(const U& other) const { return *this == other || *this > other; } template<Unsigned U> - requires(sizeof(T) >= sizeof(U)) constexpr bool operator<=(const T& other) const + requires(sizeof(T) >= sizeof(U)) constexpr bool operator<=(const U& other) const { return *this == other || *this < other; } |