diff options
author | George Hazan <ghazan@miranda.im> | 2020-01-30 20:18:37 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-01-30 20:18:46 +0300 |
commit | 4c281b28075dfa69d8cc2301b06492fbddb62f24 (patch) | |
tree | b788f37caaff5063fd36eecad191d2a5582be12c /plugins/FavContacts/src | |
parent | a243c59835182e2a1fa91d9c7bd80defea88e4e8 (diff) |
LIST::remove + LIST::indexOf() combination removed with LIST::removeItem
Diffstat (limited to 'plugins/FavContacts/src')
-rw-r--r-- | plugins/FavContacts/src/contact_cache.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index 7e69ffa91d..e3b05f2c24 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -38,13 +38,12 @@ int __cdecl CContactCache::OnDbEventAdded(WPARAM hContact, LPARAM hEvent) TContactInfo *pFound = nullptr;
mir_cslock lck(m_cs);
- auto T = m_cache.rev_iter();
- for (auto &it : T) {
+
+ for (auto &it : m_cache.rev_iter()) {
it->rate *= q;
if (it->hContact == hContact) {
it->rate += weight;
- pFound = it;
- m_cache.remove(T.indexOf(&it)); // reinsert to maintain the sort order
+ pFound = m_cache.removeItem(&it); // reinsert to maintain the sort order
}
}
|