From 9bb1605f105bc8bbee715618d5abf01a6fc47657 Mon Sep 17 00:00:00 2001 From: Junekey Jeon Date: Tue, 12 Jul 2022 16:27:05 -0700 Subject: [PATCH] Remove some branches --- include/fmt/format-inl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index a293287d..8391aa9b 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -1337,7 +1337,7 @@ template decimal_fp to_decimal(T x) noexcept { if (r < deltai) { // Exclude the right endpoint if necessary. - if (r == 0 && z_mul.is_integer && !include_right_endpoint) { + if (r == 0 && (z_mul.is_integer & !include_right_endpoint)) { --ret_value.significand; r = float_info::big_divisor; goto small_divisor_case_label; @@ -1389,7 +1389,7 @@ small_divisor_case_label: // or equivalently, when y is an integer. if (y_mul.parity != approx_y_parity) --ret_value.significand; - else if (y_mul.is_integer && ret_value.significand % 2 != 0) + else if (y_mul.is_integer & (ret_value.significand % 2 != 0)) --ret_value.significand; return ret_value; }