Fix warning C4706
This commit is contained in:
parent
19f8f1c075
commit
8a4af820c7
1 changed files with 26 additions and 10 deletions
20
src/json.hpp
20
src/json.hpp
|
@ -3034,12 +3034,20 @@ class parser
|
||||||
{
|
{
|
||||||
case token_type::begin_object:
|
case token_type::begin_object:
|
||||||
{
|
{
|
||||||
if (keep and (not callback or ((keep = callback(depth++, parse_event_t::object_start, result)))))
|
if (keep)
|
||||||
|
{
|
||||||
|
if (callback)
|
||||||
|
{
|
||||||
|
keep = callback(depth++, parse_event_t::object_start, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (not callback or keep)
|
||||||
{
|
{
|
||||||
// explicitly set result to object to cope with {}
|
// explicitly set result to object to cope with {}
|
||||||
result.m_type = value_t::object;
|
result.m_type = value_t::object;
|
||||||
result.m_value = value_t::object;
|
result.m_value = value_t::object;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// read next token
|
// read next token
|
||||||
get_token();
|
get_token();
|
||||||
|
@ -3130,12 +3138,20 @@ class parser
|
||||||
|
|
||||||
case token_type::begin_array:
|
case token_type::begin_array:
|
||||||
{
|
{
|
||||||
if (keep and (not callback or ((keep = callback(depth++, parse_event_t::array_start, result)))))
|
if (keep)
|
||||||
|
{
|
||||||
|
if (callback)
|
||||||
|
{
|
||||||
|
keep = callback(depth++, parse_event_t::array_start, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (not callback or keep)
|
||||||
{
|
{
|
||||||
// explicitly set result to object to cope with []
|
// explicitly set result to object to cope with []
|
||||||
result.m_type = value_t::array;
|
result.m_type = value_t::array;
|
||||||
result.m_value = value_t::array;
|
result.m_value = value_t::array;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// read next token
|
// read next token
|
||||||
get_token();
|
get_token();
|
||||||
|
|
Loading…
Reference in a new issue