mirror of
https://github.com/fmtlib/fmt.git
synced 2025-04-17 17:42:56 +00:00
Improve sign processing
This commit is contained in:
parent
808ea0191a
commit
0f87d6ffa6
@ -1120,7 +1120,7 @@ template <typename Char, typename Sign> constexpr auto sign(Sign s) -> Char {
|
||||
#if !FMT_GCC_VERSION || FMT_GCC_VERSION >= 604
|
||||
static_assert(std::is_same<Sign, sign_t>::value, "");
|
||||
#endif
|
||||
return static_cast<Char>("\0-+ "[s]);
|
||||
return static_cast<char>(((' ' << 24) | ('+' << 16) | ('-' << 8)) >> (s * 8));
|
||||
}
|
||||
|
||||
template <typename T> FMT_CONSTEXPR auto count_digits_fallback(T n) -> int {
|
||||
|
Loading…
x
Reference in New Issue
Block a user