mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-07 17:26:51 +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,
|
fortran = uint64_t(detail::basic_fortran_fmt) | general,
|
||||||
allow_leading_plus = 1 << 7,
|
allow_leading_plus = 1 << 7,
|
||||||
skip_white_space = 1 << 8,
|
skip_white_space = 1 << 8,
|
||||||
disallow_leading_sign = 1 << 9,
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -29,18 +29,12 @@ from_chars_result_t<UC>
|
|||||||
answer.ec = std::errc(); // be optimistic
|
answer.ec = std::errc(); // be optimistic
|
||||||
[[assume(first < last)]]; // so dereference without checks
|
[[assume(first < last)]]; // so dereference without checks
|
||||||
|
|
||||||
bool minusSign;
|
bool const minusSign = (*first == UC('-'));
|
||||||
if (!uint64_t(fmt & chars_format::disallow_leading_sign)) {
|
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here
|
||||||
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here
|
if ((*first == UC('-')) ||
|
||||||
minusSign = (*first == UC('-'));
|
(uint64_t(fmt & chars_format::allow_leading_plus) &&
|
||||||
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here
|
(*first == UC('+')))) {
|
||||||
if ((*first == UC('-')) ||
|
++first;
|
||||||
(uint64_t(fmt & chars_format::allow_leading_plus) &&
|
|
||||||
(*first == UC('+')))) {
|
|
||||||
++first;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
minusSign = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (last - first >= 3) {
|
if (last - first >= 3) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user