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/Clist_nicer/src/CLCButton.cpp | |
parent | bf8ad124d03b4fd059318d9ba8889b11faaf5b53 (diff) |
code optimization
Diffstat (limited to 'plugins/Clist_nicer/src/CLCButton.cpp')
-rw-r--r-- | plugins/Clist_nicer/src/CLCButton.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp index 49bbfd86f9..e22b9c53b0 100644 --- a/plugins/Clist_nicer/src/CLCButton.cpp +++ b/plugins/Clist_nicer/src/CLCButton.cpp @@ -72,27 +72,27 @@ static void InitDefaultButtons() void ClcSetButtonState(int ctrlid, int status)
{
- for (int i = 0; i < _countof(BTNS); i++)
- if (BTNS[i].ctrlid == ctrlid) {
- CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[i].hButton, status ? TTBST_PUSHED : 0);
+ for (auto &it : BTNS)
+ if (it.ctrlid == ctrlid) {
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)it.hButton, status ? TTBST_PUSHED : 0);
break;
}
}
HWND ClcGetButtonWindow(int ctrlid)
{
- for (int i = 0; i < _countof(BTNS); i++)
- if (BTNS[i].ctrlid == ctrlid)
- return BTNS[i].hwndButton;
+ for (auto &it : BTNS)
+ if (it.ctrlid == ctrlid)
+ return it.hwndButton;
return nullptr;
}
int ClcGetButtonId(HWND hwnd)
{
- for (int i = 0; i < _countof(BTNS); i++)
- if (BTNS[i].hwndButton == hwnd)
- return BTNS[i].ctrlid;
+ for (auto &it : BTNS)
+ if (it.hwndButton == hwnd)
+ return it.ctrlid;
return 0;
}
|