Browse Source

Change in JSON::Object::set(key,value) behavior in 1.6.1 #933

fix according to [suggestion](https://github.com/pocoproject/poco/commit/fee347ec6a92b370f37c7f74355b44fd7372fe36#commitcomment-13196733)
Aleksandar Fabijanic 10 years ago
parent
commit
4f885a8b66
1 changed files with 1 additions and 1 deletions
  1. 1 1
      JSON/src/Object.cpp

+ 1 - 1
JSON/src/Object.cpp

@@ -117,7 +117,7 @@ const std::string& Object::getKey(KeyPtrList::const_iterator& iter) const
 void Object::set(const std::string& key, const Dynamic::Var& value)
 {
 	std::pair<ValueMap::iterator, bool> ret = _values.insert(ValueMap::value_type(key, value));
-	if (!ret.second) _values[key] = value;
+	if (!ret.second) ret.first->second = value;
 	if (_preserveInsOrder)
 	{
 		KeyPtrList::iterator it = _keys.begin();