diff --git a/lib/base/dictionary.cpp b/lib/base/dictionary.cpp index 34a0fac15f9..c679fd92bba 100644 --- a/lib/base/dictionary.cpp +++ b/lib/base/dictionary.cpp @@ -155,9 +155,8 @@ Dictionary::Iterator Dictionary::End() * Removes the item specified by the iterator from the dictionary. * * @param it The iterator. - * @return an iterator to the element after the removed element. */ -Dictionary::Iterator Dictionary::Remove(Dictionary::Iterator it) +void Dictionary::Remove(Dictionary::Iterator it) { ASSERT(OwnsLock()); std::unique_lock lock (m_DataMutex); @@ -165,7 +164,7 @@ Dictionary::Iterator Dictionary::Remove(Dictionary::Iterator it) if (m_Frozen) BOOST_THROW_EXCEPTION(std::invalid_argument("Dictionary must not be modified.")); - return m_Data.erase(it); + m_Data.erase(it); } /** diff --git a/lib/base/dictionary.hpp b/lib/base/dictionary.hpp index 13ed90feaec..f9d85b907ac 100644 --- a/lib/base/dictionary.hpp +++ b/lib/base/dictionary.hpp @@ -56,7 +56,7 @@ class Dictionary final : public Object void Remove(const String& key); - Iterator Remove(Iterator it); + void Remove(Iterator it); void Clear(); diff --git a/lib/remote/apilistener-configsync.cpp b/lib/remote/apilistener-configsync.cpp index 8dde8de29aa..9c5d226a673 100644 --- a/lib/remote/apilistener-configsync.cpp +++ b/lib/remote/apilistener-configsync.cpp @@ -580,10 +580,10 @@ void ApiListener::PruneDeletedRuntimeObjects() for (auto it = deletedRuntimeObjects->Begin(); it != deletedRuntimeObjects->End();) { if (it->second < cutoff) { - it = deletedRuntimeObjects->Remove(it); + deletedRuntimeObjects->Remove(it++); } else { - it++; - }; + ++it; + } } }