diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /mozglue/misc/decimal | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mozglue/misc/decimal')
-rw-r--r-- | mozglue/misc/decimal/Decimal.cpp | 10 | ||||
-rw-r--r-- | mozglue/misc/decimal/Decimal.h | 6 |
2 files changed, 4 insertions, 12 deletions
diff --git a/mozglue/misc/decimal/Decimal.cpp b/mozglue/misc/decimal/Decimal.cpp index 7d2bcfa712..e4db6a0f1e 100644 --- a/mozglue/misc/decimal/Decimal.cpp +++ b/mozglue/misc/decimal/Decimal.cpp @@ -239,11 +239,6 @@ Decimal::Decimal(int32_t i32) Decimal::Decimal(Sign sign, int exponent, uint64_t coefficient) : m_data(sign, coefficient ? exponent : 0, coefficient) {} -Decimal::Decimal(const EncodedData& data) - : m_data(data) -{ -} - Decimal::Decimal(const Decimal& other) : m_data(other.m_data) { @@ -853,11 +848,6 @@ Decimal Decimal::infinity(const Sign sign) return Decimal(EncodedData(sign, EncodedData::ClassInfinity)); } -Decimal Decimal::nan() -{ - return Decimal(EncodedData(Positive, EncodedData::ClassNaN)); -} - Decimal Decimal::remainder(const Decimal& rhs) const { const Decimal quotient = *this / rhs; diff --git a/mozglue/misc/decimal/Decimal.h b/mozglue/misc/decimal/Decimal.h index 4bb9a841e5..8d9adbff4f 100644 --- a/mozglue/misc/decimal/Decimal.h +++ b/mozglue/misc/decimal/Decimal.h @@ -234,11 +234,13 @@ public: // Note: fromString doesn't support "infinity" and "nan". static MFBT_API Decimal fromString(const std::string& aValue); static MFBT_API Decimal infinity(Sign); - static MFBT_API Decimal nan(); + static constexpr Decimal nan() { + return Decimal(EncodedData(Positive, EncodedData::ClassNaN)); + } static MFBT_API Decimal zero(Sign); // You should not use below methods. We expose them for unit testing. - MFBT_API explicit Decimal(const EncodedData&); + constexpr explicit Decimal(const EncodedData& data) : m_data(data) {} const EncodedData& value() const { return m_data; } private: |