From 3dc26b44d34a1972e9e902dace3367b4b088b1dc Mon Sep 17 00:00:00 2001 From: Junekey Jeon Date: Thu, 13 Jan 2022 15:46:54 -0800 Subject: [PATCH] Make a fallback path more compiler-friendly --- include/fmt/format-inl.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 3a95045a..b5bf425e 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -812,9 +812,8 @@ struct uint128_wrapper { auto carry = _addcarry_u64(0, low_, n, &low_); _addcarry_u64(carry, high_, 0, &high_); #else - auto sum = low_ + n; - high_ += (sum < low_ ? 1 : 0); - low_ = sum; + low_ += n; + high_ += (low_ < n ? 1 : 0); #endif return *this; }