Skip leading zeros

This commit is contained in:
Maya Warrier 2023-12-11 04:27:22 -05:00
parent 122220e2f0
commit c9527c2e4f
2 changed files with 6 additions and 1 deletions

View File

@ -460,6 +460,11 @@ from_chars_result_t<UC> parse_int_string(UC const* p, UC const* pend, T& value,
++p;
}
// skip leading zeros
while (p != pend && *p == UC('0')) {
++p;
}
UC const* const start_digits = p;
uint64_t i = 0;

View File

@ -747,7 +747,7 @@ fastfloat_really_inline
constexpr int max_digits_u64(int base) { return int_luts<>::maxdigits_u64[base - 2]; }
// If a u64 is exactly max_digits_u64() in length, this is
// the minimum value below which it has definitely overflowed.
// the value below which it has definitely overflowed.
fastfloat_really_inline
constexpr uint64_t min_safe_u64(int base) { return int_luts<>::min_safe_u64[base - 2]; }