summaryrefslogtreecommitdiff
path: root/plugins/HistorySweeperLight/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-15 15:33:54 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-15 15:34:09 +0300
commit44b60862c97e5ec855d2bacd4d15f81f7ae7f410 (patch)
treecfe6fd232fac8c80c2f7673804352b94187d698b /plugins/HistorySweeperLight/src
parent0a03c7c9ccd36ce03bdb9feb4827314e4dd553c6 (diff)
MUCH more effective way of removing records from iterators
Diffstat (limited to 'plugins/HistorySweeperLight/src')
-rw-r--r--plugins/HistorySweeperLight/src/historysweeperlight.cpp5
1 files changed, 3 insertions, 2 deletions
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;
}