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/UserInfoEx | |
parent | a243c59835182e2a1fa91d9c7bd80defea88e4e8 (diff) |
LIST::remove + LIST::indexOf() combination removed with LIST::removeItem
Diffstat (limited to 'plugins/UserInfoEx')
-rw-r--r-- | plugins/UserInfoEx/src/classPsTree.cpp | 2 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/mir_contactqueue.cpp | 19 |
2 files changed, 7 insertions, 14 deletions
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));
}
/////////////////////////////////////////////////////////////////////////////////////////
|