# cleanup.

This commit is contained in:
IRainman 2025-03-06 23:02:50 +03:00
parent 7a38e1bc75
commit bc3f331938
2 changed files with 7 additions and 14 deletions

View File

@ -56,7 +56,6 @@ enum class chars_format : uint64_t {
fortran = uint64_t(detail::basic_fortran_fmt) | general,
allow_leading_plus = 1 << 7,
skip_white_space = 1 << 8,
disallow_leading_sign = 1 << 9,
#endif
};

View File

@ -28,19 +28,13 @@ from_chars_result_t<UC>
answer.ptr = first;
answer.ec = std::errc(); // be optimistic
[[assume(first < last)]]; // so dereference without checks
bool minusSign;
if (!uint64_t(fmt & chars_format::disallow_leading_sign)) {
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here
minusSign = (*first == UC('-'));
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here
if ((*first == UC('-')) ||
(uint64_t(fmt & chars_format::allow_leading_plus) &&
(*first == UC('+')))) {
++first;
}
} else {
minusSign = false;
bool const minusSign = (*first == UC('-'));
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here
if ((*first == UC('-')) ||
(uint64_t(fmt & chars_format::allow_leading_plus) &&
(*first == UC('+')))) {
++first;
}
if (last - first >= 3) {