diff options
Diffstat (limited to 'absl/strings/internal/charconv_bigint.h')
-rw-r--r-- | absl/strings/internal/charconv_bigint.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/absl/strings/internal/charconv_bigint.h b/absl/strings/internal/charconv_bigint.h index 9827b56e..ffafc11c 100644 --- a/absl/strings/internal/charconv_bigint.h +++ b/absl/strings/internal/charconv_bigint.h @@ -25,7 +25,7 @@ #include "absl/strings/string_view.h" namespace absl { -inline namespace lts_2018_06_20 { +inline namespace lts_2018_12_18 { namespace strings_internal { // The largest power that 5 that can be raised to, and still fit in a uint32_t. @@ -58,17 +58,10 @@ class BigUnsigned { "unsupported max_words value"); BigUnsigned() : size_(0), words_{} {} - explicit BigUnsigned(uint32_t v) : size_(v > 0 ? 1 : 0), words_{v} {} - explicit BigUnsigned(uint64_t v) - : size_(0), - words_{static_cast<uint32_t>(v & 0xffffffff), - static_cast<uint32_t>(v >> 32)} { - if (words_[1]) { - size_ = 2; - } else if (words_[0]) { - size_ = 1; - } - } + explicit constexpr BigUnsigned(uint64_t v) + : size_((v >> 32) ? 2 : v ? 1 : 0), + words_{static_cast<uint32_t>(v & 0xffffffffu), + static_cast<uint32_t>(v >> 32)} {} // Constructs a BigUnsigned from the given string_view containing a decimal // value. If the input std::string is not a decimal integer, constructs a 0 @@ -422,7 +415,7 @@ extern template class BigUnsigned<4>; extern template class BigUnsigned<84>; } // namespace strings_internal -} // inline namespace lts_2018_06_20 +} // inline namespace lts_2018_12_18 } // namespace absl #endif // ABSL_STRINGS_INTERNAL_CHARCONV_BIGINT_H_ |