diff --git a/src/json.hpp b/src/json.hpp index 9b292f1f..1c8ef68e 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -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; } diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 666f750d..b193056a 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -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; }