From aeee70a815f9247ecff7780e505a2328d4a4dd85 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 6 Sep 2021 21:14:11 -0700 Subject: [PATCH] Remove unnecessary cast --- include/fmt/format.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 049b14f0..b515d872 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1551,8 +1551,7 @@ FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, write_int_arg arg, static_assert(std::is_same>::value, ""); auto abs_value = arg.abs_value; auto prefix = arg.prefix; - auto pres_type = static_cast(specs.type); - switch (pres_type) { + switch (specs.type) { case presentation_type::none: case presentation_type::dec: { if (specs.localized && @@ -1568,7 +1567,7 @@ FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, write_int_arg arg, } case presentation_type::hex_lower: case presentation_type::hex_upper: { - bool upper = pres_type == presentation_type::hex_upper; + bool upper = specs.type == presentation_type::hex_upper; if (specs.alt) prefix_append(prefix, unsigned(upper ? 'X' : 'x') << 8 | '0'); int num_digits = count_digits<4>(abs_value); @@ -1579,7 +1578,7 @@ FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, write_int_arg arg, } case presentation_type::bin_lower: case presentation_type::bin_upper: { - bool upper = pres_type == presentation_type::bin_upper; + bool upper = specs.type == presentation_type::bin_upper; if (specs.alt) prefix_append(prefix, unsigned(upper ? 'B' : 'b') << 8 | '0'); int num_digits = count_digits<1>(abs_value);