Skip to content

Commit 3269c1c

Browse files
committed
Minor improvement to digits2
1 parent 789aa69 commit 3269c1c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/fmt/format.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,9 +1027,9 @@ using uint64_or_128_t = conditional_t<num_bits<T>() <= 64, uint64_t, uint128_t>;
10271027
(factor) * 100000, (factor) * 1000000, (factor) * 10000000, \
10281028
(factor) * 100000000, (factor) * 1000000000
10291029

1030-
// Converts value in the range [0, 100) to a string.
1031-
// GCC generates slightly better code when value is pointer-size.
1032-
inline auto digits2(size_t value) -> const char* {
1030+
// Converts value in the range [0, 100) to a string. GCC generates a bit better
1031+
// code when value is pointer-size (https://www.godbolt.org/z/5fEPMT1cc).
1032+
inline auto digits2(size_t value) noexcept -> const char* {
10331033
// Align data since unaligned access may be slower when crossing a
10341034
// hardware-specific boundary.
10351035
alignas(2) static const char data[] =

0 commit comments

Comments
 (0)