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 /protocols/Tox/src/tox_icons.cpp | |
parent | bf8ad124d03b4fd059318d9ba8889b11faaf5b53 (diff) |
code optimization
Diffstat (limited to 'protocols/Tox/src/tox_icons.cpp')
-rw-r--r-- | protocols/Tox/src/tox_icons.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/Tox/src/tox_icons.cpp b/protocols/Tox/src/tox_icons.cpp index 5e95d49c24..a94405982e 100644 --- a/protocols/Tox/src/tox_icons.cpp +++ b/protocols/Tox/src/tox_icons.cpp @@ -14,16 +14,16 @@ void CToxProto::InitIcons() HANDLE CToxProto::GetIconHandle(int iconId)
{
- for (size_t i = 0; i < _countof(Icons); i++)
- if (Icons[i].defIconID == iconId)
- return Icons[i].hIcolib;
+ for (auto &it : Icons)
+ if (it.defIconID == iconId)
+ return it.hIcolib;
return nullptr;
}
HICON CToxProto::GetIcon(int iconId)
{
- for (size_t i = 0; i < _countof(Icons); i++)
- if (Icons[i].defIconID == iconId)
- return IcoLib_GetIconByHandle(Icons[i].hIcolib);
+ for (auto &it : Icons)
+ if (it.defIconID == iconId)
+ return IcoLib_GetIconByHandle(it.hIcolib);
return nullptr;
}
|