Skip to content

Commit

Permalink
remove checking max_depth in claujson.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
vztpv authored Jan 14, 2024
1 parent 1957946 commit f3c77f2
Showing 1 changed file with 3 additions and 26 deletions.
29 changes: 3 additions & 26 deletions claujson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4746,13 +4746,6 @@ namespace claujson {
if (is_array.size() < depth) {
is_array.push_back(0);
}
if (depth >= dom_parser.max_depth()) {
log << warn << ("Exceeded max depth!");
if (err) {
*err = 1;
}
return false;
}

//dom_parser.is_array[depth] = false;
is_array[depth - 1] = 0;
Expand Down Expand Up @@ -4926,7 +4919,6 @@ namespace claujson {
state = 4;
//log_start_value("array");
depth++;
if (depth >= dom_parser.max_depth()) { log << warn << ("Exceeded max depth!"); return false; }
if (is_array.size() < depth) { is_array.push_back(1); }
is_array[depth - 1] = 1;

Expand Down Expand Up @@ -5112,14 +5104,7 @@ namespace claujson {
if (is_array.size() < depth) {
is_array.push_back(0);
}
if (depth >= dom_parser.max_depth()) {
log << warn << ("Exceeded max depth!");
if (err) {
*err = 1;
}
return false;
}


//dom_parser.is_array[depth] = false;
is_array[depth - 1] = 0;
//SIMDJSON_TRY(visitor.visit_object_start(*this));
Expand Down Expand Up @@ -5237,7 +5222,6 @@ namespace claujson {
array_begin:
//log_start_value("array");
depth++;
if (depth >= dom_parser.max_depth()) { log << warn << ("Exceeded max depth!"); return false; }
if (is_array.size() < depth) { is_array.push_back(1); }
is_array[depth - 1] = 1;

Expand Down Expand Up @@ -5559,14 +5543,7 @@ namespace claujson {
if (is_array.size() < depth) {
is_array.push_back(0);
}
if (depth >= dom_parser.max_depth()) {
log << warn << ("Exceeded max depth!");
if (err) {
*err = 1;
}
return false;
}


if (idx < middle) {
goto document_end;
}
Expand Down Expand Up @@ -6173,7 +6150,7 @@ namespace claujson {
for (; i < sz_x && i < sz_y; ++i) {
std::string new_route = route;
new_route += '/';
new_route += std::to_string(i);
new_route += std::to_string(i); // change? fmt?

Value inner_diff = _diff(jx->get_value_list(i), jy->get_value_list(i), std::move(new_route));

Expand Down

0 comments on commit f3c77f2

Please sign in to comment.