minor iterator refactoring (from #88)

This commit is contained in:
Niels 2015-06-20 14:29:34 +02:00
parent 23c904aca8
commit 18cd30d38d
2 changed files with 4 additions and 84 deletions

View file

@ -3116,27 +3116,7 @@ class basic_json
const_iterator operator++(int) const_iterator operator++(int)
{ {
auto result = *this; auto result = *this;
++(*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;
}
}
return result; return result;
} }
@ -3172,27 +3152,7 @@ class basic_json
const_iterator operator--(int) const_iterator operator--(int)
{ {
auto result = *this; auto result = *this;
--(*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;
}
}
return result; return result;
} }

View file

@ -3116,27 +3116,7 @@ class basic_json
const_iterator operator++(int) const_iterator operator++(int)
{ {
auto result = *this; auto result = *this;
++(*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;
}
}
return result; return result;
} }
@ -3172,27 +3152,7 @@ class basic_json
const_iterator operator--(int) const_iterator operator--(int)
{ {
auto result = *this; auto result = *this;
--(*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;
}
}
return result; return result;
} }