File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -1132,13 +1132,10 @@ template <typename T> constexpr uint64_t int_luts<T>::min_safe_u64[];
11321132
11331133template <typename UC>
11341134fastfloat_really_inline constexpr uint8_t ch_to_digit (UC c) {
1135+ // wchar_t and char can be signed, so we need to be careful.
11351136 using UnsignedUC = typename std::make_unsigned<UC>::type;
1136- auto uc = static_cast <UnsignedUC>(c);
1137- // For types larger than one byte, we need to force an index with sentinel
1138- // value (using index zero because that is easiest) if any byte other than
1139- // the low byte is non-zero.
1140- auto mask = static_cast <UnsignedUC>(-((uc & ~0xFFull ) == 0 ));
1141- return int_luts<>::chdigit[static_cast <unsigned char >(uc & mask)];
1137+ return int_luts<>::chdigit[static_cast <unsigned char >(static_cast <UnsignedUC>(c)
1138+ & static_cast <UnsignedUC>(-((static_cast <UnsignedUC>(c) & ~0xFFull ) == 0 )))];
11421139}
11431140
11441141fastfloat_really_inline constexpr size_t max_digits_u64 (int base) {
You can’t perform that action at this time.
0 commit comments