Removed redundant format_decimal implementation for constexpr context

This commit is contained in:
Roman Koshelev 2021-09-12 18:09:05 +03:00
parent 8c5c428622
commit 9052207625

View File

@ -1077,14 +1077,6 @@ FMT_CONSTEXPR20 auto format_decimal(Char* out, UInt value, int size)
FMT_ASSERT(size >= count_digits(value), "invalid digit count");
out += size;
Char* end = out;
if (is_constant_evaluated()) {
while (value >= 10) {
*--out = static_cast<Char>('0' + value % 10);
value /= 10;
}
*--out = static_cast<Char>('0' + value);
return {out, end};
}
while (value >= 100) {
// Integer division is slow so do it for a group of two digits instead
// of for every digit. The idea comes from the talk by Alexandrescu