mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 08:46:49 +08:00
lint
This commit is contained in:
parent
13ba430893
commit
13991611ed
@ -293,8 +293,7 @@ parse_number_string(UC const *p, UC const *pend,
|
||||
answer.negative = (*p == UC('-'));
|
||||
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here
|
||||
if ((*p == UC('-')) ||
|
||||
(allow_leading_plus &&
|
||||
!basic_json_fmt && *p == UC('+'))) {
|
||||
(allow_leading_plus && !basic_json_fmt && *p == UC('+'))) {
|
||||
++p;
|
||||
if (p == pend) {
|
||||
return report_parse_error<UC>(
|
||||
@ -494,8 +493,7 @@ parse_int_string(UC const *p, UC const *pend, T &value,
|
||||
answer.ptr = first;
|
||||
return answer;
|
||||
}
|
||||
if ((*p == UC('-')) ||
|
||||
(allow_leading_plus && (*p == UC('+')))) {
|
||||
if ((*p == UC('-')) || (allow_leading_plus && (*p == UC('+')))) {
|
||||
++p;
|
||||
}
|
||||
|
||||
|
||||
@ -306,9 +306,14 @@ from_chars_float_advanced(UC const *first, UC const *last, T &value,
|
||||
}
|
||||
bool allow_leading_plus = uint64_t(fmt & chars_format::allow_leading_plus);
|
||||
bool basic_json_fmt = uint64_t(fmt & detail::basic_json_fmt);
|
||||
parsed_number_string_t<UC> pns = allow_leading_plus ?
|
||||
(basic_json_fmt ? parse_number_string<true, true, UC>(first, last, options): parse_number_string<true, false, UC>(first, last, options)) :
|
||||
(basic_json_fmt ? parse_number_string<false, true, UC>(first, last, options): parse_number_string<false, false, UC>(first, last, options));
|
||||
parsed_number_string_t<UC> pns =
|
||||
allow_leading_plus
|
||||
? (basic_json_fmt
|
||||
? parse_number_string<true, true, UC>(first, last, options)
|
||||
: parse_number_string<true, false, UC>(first, last, options))
|
||||
: (basic_json_fmt
|
||||
? parse_number_string<false, true, UC>(first, last, options)
|
||||
: parse_number_string<false, false, UC>(first, last, options));
|
||||
if (!pns.valid) {
|
||||
if (uint64_t(fmt & chars_format::no_infnan)) {
|
||||
answer.ec = std::errc::invalid_argument;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user