@@ -383,6 +383,17 @@ really_inline bool write_float(const uint8_t *const src, bool negative, uint64_t
383
383
return true ;
384
384
}
385
385
386
+ // for performance analysis, it is sometimes useful to skip parsing
387
+ #ifdef SIMDJSON_SKIPNUMBERPARSING
388
+
389
+ template <typename W>
390
+ really_inline bool parse_number (const uint8_t *const , W &writer) {
391
+ writer.append_s64 (0 ); // always write zero
392
+ return true ; // always succeeds
393
+ }
394
+
395
+ #else
396
+
386
397
// parse the number at src
387
398
// define JSON_TEST_NUMBERS for unit testing
388
399
//
@@ -393,13 +404,7 @@ really_inline bool write_float(const uint8_t *const src, bool negative, uint64_t
393
404
//
394
405
// Our objective is accurate parsing (ULP of 0) at high speed.
395
406
template <typename W>
396
- really_inline bool parse_number (UNUSED const uint8_t *const src,
397
- W &writer) {
398
- #ifdef SIMDJSON_SKIPNUMBERPARSING // for performance analysis, it is sometimes
399
- // useful to skip parsing
400
- writer.append_s64 (0 ); // always write zero
401
- return true ; // always succeeds
402
- #else
407
+ really_inline bool parse_number (const uint8_t *const src, W &writer) {
403
408
404
409
//
405
410
// Check for minus sign
@@ -478,9 +483,9 @@ really_inline bool parse_number(UNUSED const uint8_t *const src,
478
483
WRITE_INTEGER (negative ? 0 - i : i, src, writer);
479
484
}
480
485
return is_structural_or_whitespace (*p);
486
+ }
481
487
482
488
#endif // SIMDJSON_SKIPNUMBERPARSING
483
- }
484
489
485
490
} // namespace numberparsing
486
491
} // namespace stage2
0 commit comments