summaryrefslogtreecommitdiff
path: root/src/core/stdclist
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-26 22:31:20 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-26 22:31:27 +0300
commit391980ce1e890445542441eeb5d9f9cc18ae1baf (patch)
treeee1b165175dcdaeeaabd2ddb822542e648663a90 /src/core/stdclist
parentbf8ad124d03b4fd059318d9ba8889b11faaf5b53 (diff)
code optimization
Diffstat (limited to 'src/core/stdclist')
-rw-r--r--src/core/stdclist/src/clcopts.cpp14
-rw-r--r--src/core/stdclist/src/contact.cpp8
2 files changed, 9 insertions, 13 deletions
diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp
index 7b889c2a21..932e546e52 100644
--- a/src/core/stdclist/src/clcopts.cpp
+++ b/src/core/stdclist/src/clcopts.cpp
@@ -149,12 +149,9 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE,
GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
{
- int i;
DWORD exStyle = db_get_dw(NULL, "CLC", "ExStyle", pcli->pfnGetDefaultExStyle());
- for (i = 0; i < _countof(checkBoxToStyleEx); i++)
- CheckDlgButton(hwndDlg, checkBoxToStyleEx[i].id,
- (exStyle & checkBoxToStyleEx[i].flag) ^ (checkBoxToStyleEx[i].flag *
- checkBoxToStyleEx[i].not) ? BST_CHECKED : BST_UNCHECKED);
+ for (auto &it : checkBoxToStyleEx)
+ CheckDlgButton(hwndDlg, it.id, (exStyle & it.flag) ^ (it.flag * it.not) ? BST_CHECKED : BST_UNCHECKED);
}
{
UDACCEL accel[2] = { { 0, 10 }, { 2, 50 } };
@@ -242,11 +239,10 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam
case 0:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- int i;
DWORD exStyle = 0;
- for (i = 0; i < _countof(checkBoxToStyleEx); i++)
- if ((IsDlgButtonChecked(hwndDlg, checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].not)
- exStyle |= checkBoxToStyleEx[i].flag;
+ for (auto &it : checkBoxToStyleEx)
+ if ((IsDlgButtonChecked(hwndDlg, it.id) == 0) == it.not)
+ exStyle |= it.flag;
db_set_dw(NULL, "CLC", "ExStyle", exStyle);
{
diff --git a/src/core/stdclist/src/contact.cpp b/src/core/stdclist/src/contact.cpp
index b3b46976a5..d03630e45b 100644
--- a/src/core/stdclist/src/contact.cpp
+++ b/src/core/stdclist/src/contact.cpp
@@ -44,10 +44,10 @@ static statusModeOrder[] = {
int GetStatusModeOrdering(int statusMode)
{
- int i;
- for (i = 0; i < _countof(statusModeOrder); i++)
- if (statusModeOrder[i].status == statusMode)
- return statusModeOrder[i].order;
+ for (auto &it : statusModeOrder)
+ if (it.status == statusMode)
+ return it.order;
+
return 1000;
}