From ba75602b16e4b9b484c2c05f70c117f612c81e1d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 21 Feb 2018 18:33:08 +0300 Subject: Popup+: C++'11 iterators --- plugins/Popup/src/opt_class.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'plugins/Popup/src/opt_class.cpp') diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index 1b7cf2b05c..582fddbe55 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -181,9 +181,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l ImageList_ReplaceIcon(hImgLst, -1, LoadIconEx(IDI_OPT_GROUP)); TreeView_SetImageList(hwndTree, hImgLst, TVSIL_NORMAL); - for (int i = 0; i < gTreeData.getCount(); ++i) { - POPUPTREEDATA *p = gTreeData[i]; - + for (auto &p : gTreeData) { wchar_t itemName[MAXMODULELABELLENGTH]; int iconIndex; @@ -438,8 +436,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case 0: switch (((LPNMHDR)lParam)->code) { case PSN_RESET: - for (int i = 0; i < gTreeData.getCount(); ++i) { - POPUPTREEDATA *p = gTreeData[i]; + for (auto &p : gTreeData) { switch (p->typ) { case 1: LoadNotificationSettings(p, "PopupNotifications"); @@ -453,8 +450,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l return TRUE; case PSN_APPLY: - for (int i = 0; i < gTreeData.getCount(); ++i) { - POPUPTREEDATA *p = gTreeData[i]; + for (auto &p : gTreeData) { switch (p->typ) { case 1: p->notification.iSeconds = p->timeoutValue; -- cgit v1.2.3