提交 8a4af820 编写于 作者: J Jamie Seward

Fix warning C4706

上级 19f8f1c0
...@@ -3034,12 +3034,20 @@ class parser ...@@ -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)
{ {
// explicitly set result to object to cope with {} if (callback)
result.m_type = value_t::object; {
result.m_value = value_t::object; keep = callback(depth++, parse_event_t::object_start, result);
} }
if (not callback or keep)
{
// explicitly set result to object to cope with {}
result.m_type = value_t::object;
result.m_value = value_t::object;
}
}
// read next token // read next token
get_token(); get_token();
...@@ -3130,11 +3138,19 @@ class parser ...@@ -3130,11 +3138,19 @@ 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)
{ {
// explicitly set result to object to cope with [] if (callback)
result.m_type = value_t::array; {
result.m_value = value_t::array; keep = callback(depth++, parse_event_t::array_start, result);
}
if (not callback or keep)
{
// explicitly set result to object to cope with []
result.m_type = value_t::array;
result.m_value = value_t::array;
}
} }
// read next token // read next token
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册