From 391980ce1e890445542441eeb5d9f9cc18ae1baf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 26 Jan 2018 22:31:20 +0300 Subject: code optimization --- plugins/DbEditorPP/src/icons.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins/DbEditorPP') diff --git a/plugins/DbEditorPP/src/icons.cpp b/plugins/DbEditorPP/src/icons.cpp index 683b90fbe7..6a98c9a86d 100644 --- a/plugins/DbEditorPP/src/icons.cpp +++ b/plugins/DbEditorPP/src/icons.cpp @@ -42,9 +42,9 @@ IconItem iconList[] = { HANDLE GetIcoLibHandle(int icon) { - for (int i = 0; i < _countof(iconList); i++) - if (iconList[i].defIconID == icon) - return iconList[i].hIcolib; + for (auto &it : iconList) + if (it.defIconID == icon) + return it.hIcolib; return INVALID_HANDLE_VALUE; } @@ -55,9 +55,9 @@ void IcoLibRegister(void) HICON LoadSkinnedDBEIcon(int icon) { - for (int i = 0; i < _countof(iconList); i++) - if (iconList[i].defIconID == icon) - return IcoLib_GetIconByHandle(iconList[i].hIcolib); + for (auto &it : iconList) + if (it.defIconID == icon) + return IcoLib_GetIconByHandle(it.hIcolib); return LoadIcon(hInst, MAKEINTRESOURCE(icon)); } @@ -69,8 +69,8 @@ HIMAGELIST LoadIcons() if (!hil) return nullptr; - for(int i = 0; i < _countof(dbeIcons); i++) - ImageList_AddIcon(hil, LoadSkinnedDBEIcon(dbeIcons[i])); + for (auto &it : dbeIcons) + ImageList_AddIcon(hil, LoadSkinnedDBEIcon(it)); int protoCount = 0; PROTOACCOUNT **protocols = nullptr; -- cgit v1.2.3