Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/base/dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,16 @@ 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<std::shared_timed_mutex> lock (m_DataMutex);

if (m_Frozen)
BOOST_THROW_EXCEPTION(std::invalid_argument("Dictionary must not be modified."));

return m_Data.erase(it);
m_Data.erase(it);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/base/dictionary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Dictionary final : public Object

void Remove(const String& key);

Iterator Remove(Iterator it);
void Remove(Iterator it);

void Clear();

Expand Down
6 changes: 3 additions & 3 deletions lib/remote/apilistener-configsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down
Loading