Skip to content

Commit c27936e

Browse files
committed
Value::removeMember moves the existing value to "removed" now
1 parent edb4bdb commit c27936e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib_json/json_value.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,11 @@ bool Value::removeMember(const char* key, const char* cend, Value* removed)
11861186
ObjectValues::iterator it = value_.map_->find(actualKey);
11871187
if (it == value_.map_->end())
11881188
return false;
1189+
#if JSON_HAS_RVALUE_REFERENCES
1190+
*removed = std::move(it->second);
1191+
#else
11891192
*removed = it->second;
1193+
#endif
11901194
value_.map_->erase(it);
11911195
return true;
11921196
}

0 commit comments

Comments
 (0)