From 81367a9a10c3d52c9406a56b67c4876a87eaac90 Mon Sep 17 00:00:00 2001 From: Niels Date: Tue, 10 Dec 2013 12:44:23 +0100 Subject: [PATCH] fixed a cppcheck warning --- src/JSON.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/JSON.cc b/src/JSON.cc index ecc3d93a..0b990290 100644 --- a/src/JSON.cc +++ b/src/JSON.cc @@ -614,8 +614,7 @@ JSON::iterator JSON::find(const char* key) { } else { const object_t::iterator i = _value.object->find(key); if (i != _value.object->end()) { - JSON::iterator result; - result._object = this; + JSON::iterator result(this); result._oi = new object_t::iterator(i); return result; } else { @@ -630,8 +629,7 @@ JSON::const_iterator JSON::find(const char* key) const { } else { const object_t::const_iterator i = _value.object->find(key); if (i != _value.object->end()) { - JSON::const_iterator result; - result._object = this; + JSON::const_iterator result(this); result._oi = new object_t::const_iterator(i); return result; } else {