]> granicus.if.org Git - icinga2/commitdiff
Use operator[] instead of insert() for Dictionary::Set
authorGunnar Beutner <gunnar@beutner.name>
Thu, 22 Oct 2015 16:30:47 +0000 (18:30 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Fri, 23 Oct 2015 04:19:46 +0000 (06:19 +0200)
refs #10428

lib/base/dictionary.cpp

index c4b9d2e4540e5a6b827f47fd8321c355e8016e59..9afb2568121e2b589bc027c20aa6a06581637b57 100644 (file)
@@ -78,10 +78,7 @@ void Dictionary::Set(const String& key, const Value& value)
        ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
-       std::pair<std::map<String, Value>::iterator, bool> ret;
-       ret = m_Data.insert(std::make_pair(key, value));
-       if (!ret.second)
-               ret.first->second = value;
+       m_Data[key] = value;
 }