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/UserInfoEx/src/classPsTree.cpp | 2 +- plugins/UserInfoEx/src/mir_contactqueue.cpp | 19 ++++++------------- 2 files changed, 7 insertions(+), 14 deletions(-) (limited to 'plugins/UserInfoEx') diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index 7e3a9bb73a..cd800ff5a2 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -136,7 +136,7 @@ void CPsTree::Remove(HINSTANCE hInst) TreeView_DeleteAllItems(_hWndTree); bRemoved = true; } - _pages.remove(_pages.indexOf(&it)); + _pages.removeItem(&it); } } diff --git a/plugins/UserInfoEx/src/mir_contactqueue.cpp b/plugins/UserInfoEx/src/mir_contactqueue.cpp index 9b49a2c261..8a93812287 100644 --- a/plugins/UserInfoEx/src/mir_contactqueue.cpp +++ b/plugins/UserInfoEx/src/mir_contactqueue.cpp @@ -83,13 +83,9 @@ void CContactQueue::RemoveAll(MCONTACT hContact) { mir_cslock lck(_cs); - auto T = _queue.rev_iter(); - for (auto &qi : T) { - if (qi->hContact == hContact) { - mir_free(qi); - _queue.remove(T.indexOf(&qi)); - } - } + for (auto &qi : _queue.rev_iter()) + if (qi->hContact == hContact) + mir_free(_queue.removeItem(&qi)); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -99,12 +95,9 @@ void CContactQueue::RemoveAllConsiderParam(MCONTACT hContact, PVOID param) { mir_cslock lck(_cs); - auto T = _queue.rev_iter(); - for (auto &qi : T) - if (qi->hContact == hContact && qi->param == param) { - mir_free(qi); - _queue.remove(T.indexOf(&qi)); - } + for (auto &qi : _queue.rev_iter()) + if (qi->hContact == hContact && qi->param == param) + mir_free(_queue.removeItem(&qi)); } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3