mirror of
https://github.com/nlohmann/json
synced 2024-11-25 13:20:05 +00:00
fixed a cppcheck warning
This commit is contained in:
parent
a8f62ca052
commit
81367a9a10
@ -614,8 +614,7 @@ JSON::iterator JSON::find(const char* key) {
|
|||||||
} else {
|
} else {
|
||||||
const object_t::iterator i = _value.object->find(key);
|
const object_t::iterator i = _value.object->find(key);
|
||||||
if (i != _value.object->end()) {
|
if (i != _value.object->end()) {
|
||||||
JSON::iterator result;
|
JSON::iterator result(this);
|
||||||
result._object = this;
|
|
||||||
result._oi = new object_t::iterator(i);
|
result._oi = new object_t::iterator(i);
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
@ -630,8 +629,7 @@ JSON::const_iterator JSON::find(const char* key) const {
|
|||||||
} else {
|
} else {
|
||||||
const object_t::const_iterator i = _value.object->find(key);
|
const object_t::const_iterator i = _value.object->find(key);
|
||||||
if (i != _value.object->end()) {
|
if (i != _value.object->end()) {
|
||||||
JSON::const_iterator result;
|
JSON::const_iterator result(this);
|
||||||
result._object = this;
|
|
||||||
result._oi = new object_t::const_iterator(i);
|
result._oi = new object_t::const_iterator(i);
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user