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/Import | |
parent | bf8ad124d03b4fd059318d9ba8889b11faaf5b53 (diff) |
code optimization
Diffstat (limited to 'plugins/Import')
-rw-r--r-- | plugins/Import/src/import.cpp | 2 | ||||
-rw-r--r-- | plugins/Import/src/miranda.cpp | 12 | ||||
-rw-r--r-- | plugins/Import/src/utils.cpp | 12 |
3 files changed, 13 insertions, 13 deletions
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index 2d4e756943..249c998afe 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -77,7 +77,7 @@ void AddMessage(const wchar_t* fmt, ...) va_list args;
wchar_t msgBuf[4096];
va_start(args, fmt);
- mir_vsnwprintf(msgBuf, _countof(msgBuf), TranslateW(fmt), args);
+ mir_vsnwprintf(msgBuf, TranslateW(fmt), args);
SendMessage(hdlgProgress, PROGM_ADDMESSAGE, 0, (LPARAM)msgBuf);
}
diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp index 1fa7471f63..d2fef1228c 100644 --- a/plugins/Import/src/miranda.cpp +++ b/plugins/Import/src/miranda.cpp @@ -303,16 +303,16 @@ INT_PTR CALLBACK MirandaAdvOptionsPageProc(HWND hwndDlg, UINT message, WPARAM wP case IDC_INCOMING:
case IDC_OUTGOING:
if (LOWORD(wParam) == IDC_ALL)
- for (int i = 0; i < _countof(SysControls); i++)
- CheckDlgButton(hwndDlg, SysControls[i], IsDlgButtonChecked(hwndDlg, SysControls[i]) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ for (auto &it : SysControls)
+ CheckDlgButton(hwndDlg, it, IsDlgButtonChecked(hwndDlg, it) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
if (LOWORD(wParam) != IDC_OUTGOING)
- for (int i = 0; i < _countof(InControls); i++)
- CheckDlgButton(hwndDlg, InControls[i], IsDlgButtonChecked(hwndDlg, InControls[i]) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ for (auto &it : InControls)
+ CheckDlgButton(hwndDlg, it, IsDlgButtonChecked(hwndDlg, it) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
if (LOWORD(wParam) != IDC_INCOMING)
- for (int i = 0; i < _countof(OutControls); i++)
- CheckDlgButton(hwndDlg, OutControls[i], IsDlgButtonChecked(hwndDlg, OutControls[i]) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ for (auto &it : OutControls)
+ CheckDlgButton(hwndDlg, it, IsDlgButtonChecked(hwndDlg, it) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
break;
case IDC_MSG:
diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp index 77e60895cd..8f83ed3f8b 100644 --- a/plugins/Import/src/utils.cpp +++ b/plugins/Import/src/utils.cpp @@ -197,18 +197,18 @@ static IconItem iconList[] = HICON GetIcon(int iIconId, bool size)
{
- for (int i = 0; i < _countof(iconList); i++)
- if (iconList[i].defIconID == iIconId)
- return IcoLib_GetIconByHandle(iconList[i].hIcolib, size);
+ for (auto &it : iconList)
+ if (it.defIconID == iIconId)
+ return IcoLib_GetIconByHandle(it.hIcolib, size);
return nullptr;
}
HANDLE GetIconHandle(int iIconId)
{
- for (int i = 0; i < _countof(iconList); i++)
- if (iconList[i].defIconID == iIconId)
- return iconList[i].hIcolib;
+ for (auto &it : iconList)
+ if (it.defIconID == iIconId)
+ return it.hIcolib;
return nullptr;
}
|