summaryrefslogtreecommitdiff
path: root/plugins/FavContacts/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-01-30 20:18:37 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-01-30 20:18:46 +0300
commit4c281b28075dfa69d8cc2301b06492fbddb62f24 (patch)
treeb788f37caaff5063fd36eecad191d2a5582be12c /plugins/FavContacts/src
parenta243c59835182e2a1fa91d9c7bd80defea88e4e8 (diff)
LIST::remove + LIST::indexOf() combination removed with LIST::removeItem
Diffstat (limited to 'plugins/FavContacts/src')
-rw-r--r--plugins/FavContacts/src/contact_cache.cpp7
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
}
}