From 4c281b28075dfa69d8cc2301b06492fbddb62f24 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 30 Jan 2020 20:18:37 +0300 Subject: LIST::remove + LIST::indexOf() combination removed with LIST::removeItem --- plugins/FavContacts/src/contact_cache.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'plugins/FavContacts') 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 } } -- cgit v1.2.3