Skip to content

Commit

Permalink
Removed redundant format_decimal implementation for constexpr context
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman-Koshelev committed Sep 12, 2021
1 parent 0247139 commit 4d79384
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1099,14 +1099,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
Expand Down

0 comments on commit 4d79384

Please sign in to comment.