diff options
author | George Hazan <ghazan@miranda.im> | 2018-01-26 22:31:20 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-26 22:31:27 +0300 |
commit | 391980ce1e890445542441eeb5d9f9cc18ae1baf (patch) | |
tree | ee1b165175dcdaeeaabd2ddb822542e648663a90 /plugins/HistorySweeperLight/src | |
parent | bf8ad124d03b4fd059318d9ba8889b11faaf5b53 (diff) |
code optimization
Diffstat (limited to 'plugins/HistorySweeperLight/src')
-rw-r--r-- | plugins/HistorySweeperLight/src/options.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index b503a09580..7d8071eb63 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -68,9 +68,9 @@ HICON LoadIconEx(const char* name) HANDLE GetIconHandle(const char* name)
{
- for (int i = 0; i < _countof(iconList); i++)
- if (mir_strcmp(iconList[i].szName, name) == 0)
- return hIconLibItem[i];
+ for (auto &it : iconList)
+ if (mir_strcmp(it.szName, name) == 0)
+ return ⁢
return nullptr;
}
@@ -100,7 +100,6 @@ static void ShowAllContactIcons(HWND hwndList) void LoadSettings(HWND hwndDlg)
{
- int i;
HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST);
CLCINFOITEM cii = { 0 };
@@ -118,13 +117,13 @@ void LoadSettings(HWND hwndDlg) SendDlgItemMessage(hwndDlg, IDC_SSOLDER, CB_RESETCONTENT, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_SSKEEP, CB_RESETCONTENT, 0, 0);
- for (i = 0; i < _countof(time_stamp_strings); i++) {
- ptrW ptszTimeStr(Langpack_PcharToTchar(time_stamp_strings[i]));
+ for (auto &it : time_stamp_strings) {
+ ptrW ptszTimeStr(Langpack_PcharToTchar(it));
SendDlgItemMessage(hwndDlg, IDC_SSOLDER, CB_ADDSTRING, 0, (LPARAM)ptszTimeStr);
}
- for (i = 0; i < _countof(keep_strings); i++) {
- ptrW ptszTimeStr(Langpack_PcharToTchar(keep_strings[i]));
+ for (auto &it : keep_strings) {
+ ptrW ptszTimeStr(Langpack_PcharToTchar(it));
SendDlgItemMessage(hwndDlg, IDC_SSKEEP, CB_ADDSTRING, 0, (LPARAM)ptszTimeStr);
}
@@ -134,8 +133,7 @@ void LoadSettings(HWND hwndDlg) CheckDlgButton(hwndDlg, IDC_UNSAFEMODE, db_get_b(NULL, ModuleName, "UnsafeMode", 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SWEEPONCLOSE, db_get_b(NULL, ModuleName, "SweepOnClose", 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_HISTMW, db_get_b(NULL, ModuleName, "ChangeInMW", 0) ? BST_CHECKED : BST_UNCHECKED);
-}//LoadSettings
-
+}
void SaveSettings(HWND hwndDlg)
{
|