Commit 18cd30d3 authored by Niels's avatar Niels

minor iterator refactoring (from #88)

parent 23c904ac
......@@ -3116,27 +3116,7 @@ class basic_json
const_iterator operator++(int)
{
auto result = *this;
switch (m_object->m_type)
{
case (basic_json::value_t::object):
{
m_it.object_iterator++;
break;
}
case (basic_json::value_t::array):
{
m_it.array_iterator++;
break;
}
default:
{
m_it.generic_iterator++;
break;
}
}
++(*this);
return result;
}
......@@ -3172,27 +3152,7 @@ class basic_json
const_iterator operator--(int)
{
auto result = *this;
switch (m_object->m_type)
{
case (basic_json::value_t::object):
{
m_it.object_iterator--;
break;
}
case (basic_json::value_t::array):
{
m_it.array_iterator--;
break;
}
default:
{
m_it.generic_iterator--;
break;
}
}
--(*this);
return result;
}
......
......@@ -3116,27 +3116,7 @@ class basic_json
const_iterator operator++(int)
{
auto result = *this;
switch (m_object->m_type)
{
case (basic_json::value_t::object):
{
m_it.object_iterator++;
break;
}
case (basic_json::value_t::array):
{
m_it.array_iterator++;
break;
}
default:
{
m_it.generic_iterator++;
break;
}
}
++(*this);
return result;
}
......@@ -3172,27 +3152,7 @@ class basic_json
const_iterator operator--(int)
{
auto result = *this;
switch (m_object->m_type)
{
case (basic_json::value_t::object):
{
m_it.object_iterator--;
break;
}
case (basic_json::value_t::array):
{
m_it.array_iterator--;
break;
}
default:
{
m_it.generic_iterator--;
break;
}
}
--(*this);
return result;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment