mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-07 09:16:50 +08:00
# cleanup.
This commit is contained in:
parent
7a38e1bc75
commit
bc3f331938
@ -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
|
||||
};
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user