Move is_array management together with depth

This commit is contained in:
John Keiser 2020-08-12 12:08:16 -07:00
parent e180dc44bc
commit 872127b722
1 changed files with 2 additions and 2 deletions

View File

@ -143,8 +143,8 @@ object_begin:
log_start_value("object");
depth++;
if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
SIMDJSON_TRY( visitor.visit_object_start(*this) );
dom_parser.is_array[depth] = false;
SIMDJSON_TRY( visitor.visit_object_start(*this) );
{
auto key = advance();
@ -191,8 +191,8 @@ array_begin:
log_start_value("array");
depth++;
if (depth >= dom_parser.max_depth()) { log_error("Exceeded max depth!"); return DEPTH_ERROR; }
SIMDJSON_TRY( visitor.visit_array_start(*this) );
dom_parser.is_array[depth] = true;
SIMDJSON_TRY( visitor.visit_array_start(*this) );
SIMDJSON_TRY( visitor.increment_count(*this) );
array_value: