mirror of
https://github.com/nlohmann/json
synced 2024-11-29 23:21:04 +00:00
🔨 cleanup
This commit is contained in:
parent
606a25195f
commit
375b05a17d
@ -277,18 +277,24 @@ class json_sax_dom_parser : public json_sax<BasicJsonType>
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(ref_stack.back()->is_array() or ref_stack.back()->is_object());
|
||||
if (ref_stack.back()->is_array())
|
||||
switch (ref_stack.back()->m_type)
|
||||
{
|
||||
case value_t::array:
|
||||
{
|
||||
ref_stack.back()->m_value.array->push_back(BasicJsonType(std::forward<Value>(v)));
|
||||
return &(ref_stack.back()->m_value.array->back());
|
||||
}
|
||||
else
|
||||
|
||||
case value_t::object:
|
||||
{
|
||||
assert(object_element);
|
||||
*object_element = BasicJsonType(std::forward<Value>(v));
|
||||
return object_element;
|
||||
}
|
||||
|
||||
default:
|
||||
assert(false); // LCOV_EXCL_LINE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3413,18 +3413,24 @@ class json_sax_dom_parser : public json_sax<BasicJsonType>
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(ref_stack.back()->is_array() or ref_stack.back()->is_object());
|
||||
if (ref_stack.back()->is_array())
|
||||
switch (ref_stack.back()->m_type)
|
||||
{
|
||||
case value_t::array:
|
||||
{
|
||||
ref_stack.back()->m_value.array->push_back(BasicJsonType(std::forward<Value>(v)));
|
||||
return &(ref_stack.back()->m_value.array->back());
|
||||
}
|
||||
else
|
||||
|
||||
case value_t::object:
|
||||
{
|
||||
assert(object_element);
|
||||
*object_element = BasicJsonType(std::forward<Value>(v));
|
||||
return object_element;
|
||||
}
|
||||
|
||||
default:
|
||||
assert(false); // LCOV_EXCL_LINE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user