Start parsing at depth 1 instead of using descend_to for it

This commit is contained in:
John Keiser 2021-02-05 14:23:54 -08:00
parent 7a324da548
commit ea119a5679
1 changed files with 5 additions and 3 deletions

View File

@ -23,10 +23,12 @@ simdjson_really_inline json_iterator::json_iterator(const uint8_t *buf, ondemand
: token(buf, _parser->implementation->structural_indexes.get()),
parser{_parser},
_string_buf_loc{parser->string_buf.get()},
_depth{0}
_depth{1}
{
// Release the string buf so it can be reused by the next document
descend_to(1);
#if SIMDJSON_API_USAGE_CHECKS
parser->start_positions[0] = token.index;
parser->start_positions[1] = token.index;
#endif
logger::log_headers();
}