From 44b60862c97e5ec855d2bacd4d15f81f7ae7f410 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 15 Mar 2018 15:33:54 +0300 Subject: MUCH more effective way of removing records from iterators --- plugins/HistorySweeperLight/src/historysweeperlight.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/HistorySweeperLight/src') diff --git a/plugins/HistorySweeperLight/src/historysweeperlight.cpp b/plugins/HistorySweeperLight/src/historysweeperlight.cpp index 65c37b0196..62a6f3b102 100644 --- a/plugins/HistorySweeperLight/src/historysweeperlight.cpp +++ b/plugins/HistorySweeperLight/src/historysweeperlight.cpp @@ -224,9 +224,10 @@ int OnWindowEvent(WPARAM, LPARAM lParam) SweepHistoryFromContact(msgEvData->hContact, Criteria, TRUE); } - for (auto &it : g_hWindows.rev_iter()) + auto T = g_hWindows.rev_iter(); + for (auto &it : T) if (it == PVOID(msgEvData->hContact)) - g_hWindows.remove(it); + g_hWindows.remove(T.indexOf(&it)); break; } -- cgit v1.2.3