From 477a6ea70d0bb1b1dfe9cbd9a15b6dad0284ddeb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 21 Feb 2018 18:40:03 +0300 Subject: all another C++'11 iterators --- protocols/Gadu-Gadu/src/links.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'protocols/Gadu-Gadu/src/links.cpp') diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp index 02e4986236..295e9dbcf2 100644 --- a/protocols/Gadu-Gadu/src/links.cpp +++ b/protocols/Gadu-Gadu/src/links.cpp @@ -60,15 +60,13 @@ static INT_PTR gg_parselink(WPARAM, LPARAM lParam) GaduProto *gg = nullptr; int items = 0; - for (int i = 0; i < g_Instances.getCount(); i++) { - gg = g_Instances[i]; - - if (gg->m_iStatus > ID_STATUS_OFFLINE) { + for (auto &it : g_Instances) { + gg = it; + if (it->m_iStatus > ID_STATUS_OFFLINE) { ++items; - Menu_ModifyItem(gg->hInstanceMenuItem, nullptr, Skin_LoadProtoIcon(gg->m_szModuleName, gg->m_iStatus)); + Menu_ModifyItem(it->hInstanceMenuItem, nullptr, Skin_LoadProtoIcon(it->m_szModuleName, it->m_iStatus)); } - else - Menu_ShowItem(gg->hInstanceMenuItem, false); + else Menu_ShowItem(it->hInstanceMenuItem, false); } if (items > 1) { -- cgit v1.2.3