Skip to content

Commit 1399161

Browse files
committed
lint
1 parent 13ba430 commit 1399161

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

benchmarks/benchmark.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ int main(int argc, char **argv) {
236236
<< std::endl;
237237
#endif
238238
}
239-
if(argc > 1) {
239+
if (argc > 1) {
240240
fileload(argv[1]);
241241
return EXIT_SUCCESS;
242242
}

include/fast_float/ascii_number.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ parse_number_string(UC const *p, UC const *pend,
293293
answer.negative = (*p == UC('-'));
294294
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here
295295
if ((*p == UC('-')) ||
296-
(allow_leading_plus &&
297-
!basic_json_fmt && *p == UC('+'))) {
296+
(allow_leading_plus && !basic_json_fmt && *p == UC('+'))) {
298297
++p;
299298
if (p == pend) {
300299
return report_parse_error<UC>(
@@ -474,7 +473,7 @@ template <bool allow_leading_plus = false, typename T, typename UC>
474473
fastfloat_really_inline FASTFLOAT_CONSTEXPR20 from_chars_result_t<UC>
475474
parse_int_string(UC const *p, UC const *pend, T &value,
476475
parse_options_t<UC> options) {
477-
//chars_format const fmt = detail::adjust_for_feature_macros(options.format);
476+
// chars_format const fmt = detail::adjust_for_feature_macros(options.format);
478477
int const base = options.base;
479478

480479
from_chars_result_t<UC> answer;
@@ -494,8 +493,7 @@ parse_int_string(UC const *p, UC const *pend, T &value,
494493
answer.ptr = first;
495494
return answer;
496495
}
497-
if ((*p == UC('-')) ||
498-
(allow_leading_plus && (*p == UC('+')))) {
496+
if ((*p == UC('-')) || (allow_leading_plus && (*p == UC('+')))) {
499497
++p;
500498
}
501499

include/fast_float/parse_number.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,14 @@ from_chars_float_advanced(UC const *first, UC const *last, T &value,
306306
}
307307
bool allow_leading_plus = uint64_t(fmt & chars_format::allow_leading_plus);
308308
bool basic_json_fmt = uint64_t(fmt & detail::basic_json_fmt);
309-
parsed_number_string_t<UC> pns = allow_leading_plus ?
310-
(basic_json_fmt ? parse_number_string<true, true, UC>(first, last, options): parse_number_string<true, false, UC>(first, last, options)) :
311-
(basic_json_fmt ? parse_number_string<false, true, UC>(first, last, options): parse_number_string<false, false, UC>(first, last, options));
309+
parsed_number_string_t<UC> pns =
310+
allow_leading_plus
311+
? (basic_json_fmt
312+
? parse_number_string<true, true, UC>(first, last, options)
313+
: parse_number_string<true, false, UC>(first, last, options))
314+
: (basic_json_fmt
315+
? parse_number_string<false, true, UC>(first, last, options)
316+
: parse_number_string<false, false, UC>(first, last, options));
312317
if (!pns.valid) {
313318
if (uint64_t(fmt & chars_format::no_infnan)) {
314319
answer.ec = std::errc::invalid_argument;

0 commit comments

Comments
 (0)