diff options
Diffstat (limited to 'plugins/FavContacts')
-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
}
}
|