diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-21 18:36:32 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:14 +0300 |
commit | 6e96535fdbb886dcad1a3396659b368283922e64 (patch) | |
tree | ef1a35a5ca0c43fcf10a1190a47853588e90cddc /protocols/JabberG/src/jabber_menu.cpp | |
parent | fd23a292afc4aa760a0ff8ab646eebe5942fb06d (diff) |
Jabber: C++'11 iterators
Diffstat (limited to 'protocols/JabberG/src/jabber_menu.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_menu.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 35d24eb16d..f5026821e6 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -81,9 +81,9 @@ static CJabberProto* JabberGetInstanceByHContact(MCONTACT hContact) if (szProto == nullptr)
return nullptr;
- for (int i = 0; i < g_Instances.getCount(); i++)
- if (!mir_strcmp(szProto, g_Instances[i]->m_szModuleName))
- return g_Instances[i];
+ for (auto &it : g_Instances)
+ if (!mir_strcmp(szProto, it->m_szModuleName))
+ return it;
return nullptr;
}
@@ -863,8 +863,8 @@ void CJabberProto::CheckMenuItems() Menu_ShowItem(m_hMenuPriorityRoot, m_menuItemsStatus != 0);
- for (int i = 0; i < m_pepServices.getCount(); i++)
- Menu_ShowItem(m_pepServices[i].GetMenu(), m_bPepSupported);
+ for (auto &it : m_pepServices)
+ Menu_ShowItem(it->GetMenu(), m_bPepSupported);
JabberUpdateDialogs(m_menuItemsStatus);
}
@@ -1062,9 +1062,9 @@ CJabberProto* JabberChooseInstance(bool bIsLink) }
if (bIsLink)
- for (int i = 0; i < g_Instances.getCount(); i++)
- if (g_Instances[i]->m_options.ProcessXMPPLinks)
- return g_Instances[i];
+ for (auto &it : g_Instances)
+ if (it->m_options.ProcessXMPPLinks)
+ return it;
int nItems = 0, lastItemId = 0;
for (int i = 0; i < g_Instances.getCount(); i++) {
|