From dad59528ccd770301b29c7db8148ff8ab8e89c92 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 14 Mar 2018 19:59:06 +0300 Subject: reverse iterators for LIST<> --- plugins/HistorySweeperLight/src/historysweeperlight.cpp | 6 +++--- plugins/HistorySweeperLight/src/main.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/HistorySweeperLight/src') diff --git a/plugins/HistorySweeperLight/src/historysweeperlight.cpp b/plugins/HistorySweeperLight/src/historysweeperlight.cpp index ad73c5d46c..65c37b0196 100644 --- a/plugins/HistorySweeperLight/src/historysweeperlight.cpp +++ b/plugins/HistorySweeperLight/src/historysweeperlight.cpp @@ -224,9 +224,9 @@ int OnWindowEvent(WPARAM, LPARAM lParam) SweepHistoryFromContact(msgEvData->hContact, Criteria, TRUE); } - for (int i = g_hWindows.getCount() - 1; i >= 0; i--) - if (g_hWindows[i] == PVOID(msgEvData->hContact)) - g_hWindows.remove(i); + for (auto &it : g_hWindows.rev_iter()) + if (it == PVOID(msgEvData->hContact)) + g_hWindows.remove(it); break; } diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp index 0c1fdc4aac..e0fee84c71 100644 --- a/plugins/HistorySweeperLight/src/main.cpp +++ b/plugins/HistorySweeperLight/src/main.cpp @@ -25,7 +25,7 @@ HINSTANCE hInst; int hLangpack; -LIST g_hWindows(5); +LIST g_hWindows(5, PtrKeySortT); static PLUGININFOEX pluginInfoEx = { -- cgit v1.2.3