+ that could be it!

This commit is contained in:
Niels 2014-12-28 23:09:31 +01:00
parent 776611c270
commit bed47db168

View file

@ -1367,22 +1367,14 @@ JSON::iterator::iterator(JSON* j) : _object(j)
JSON::iterator::iterator(const JSON::iterator& o) : _object(o._object)
{
if (_object != nullptr)
switch (_object->_type)
{
case (value_type::array):
if (_object->_type == value_type::array)
{
_vi = new array_t::iterator(*(o._vi));
break;
}
case (value_type::object):
if (_object->_type == value_type::object)
{
_oi = new object_t::iterator(*(o._oi));
break;
}
default:
{
// not sure if used
break;
}
}
}
@ -1409,28 +1401,14 @@ bool JSON::iterator::operator==(const JSON::iterator& o) const
}
if (_object != nullptr)
switch (_object->_type)
{
case (value_type::array):
if (_object->_type == value_type::array)
{
if (_vi != o._vi)
{
return false;
return (_vi == o._vi);
}
break;
}
case (value_type::object):
if (_object->_type == value_type::object)
{
if (_oi != o._oi)
{
return false;
}
break;
}
default:
{
// not sure if used
break;
return (_oi == o._oi);
}
}
@ -1589,21 +1567,14 @@ JSON::const_iterator::const_iterator(const JSON* j) : _object(j)
JSON::const_iterator::const_iterator(const JSON::const_iterator& o) : _object(o._object)
{
if (_object != nullptr)
switch (_object->_type)
{
case (value_type::array):
if (_object->_type == value_type::array)
{
_vi = new array_t::const_iterator(*(o._vi));
break;
}
case (value_type::object):
if (_object->_type == value_type::object)
{
_oi = new object_t::const_iterator(*(o._oi));
break;
}
default:
{
break;
}
}
}
@ -1652,28 +1623,14 @@ bool JSON::const_iterator::operator==(const JSON::const_iterator& o) const
}
if (_object != nullptr)
switch (_object->_type)
{
case (value_type::array):
if (_object->_type == value_type::array)
{
if (_vi != o._vi)
{
return false;
return (_vi == o._vi);
}
break;
}
case (value_type::object):
if (_object->_type == value_type::object)
{
if (_oi != o._oi)
{
return false;
}
break;
}
default:
{
// not sure if used
break;
return (_oi == o._oi);
}
}