diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-16 12:09:30 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-16 12:09:38 +0300 |
commit | a7e5e613f86963c8bf82248ab044e0ea36e42fbc (patch) | |
tree | 39e0e6b3ab4bcb55255302d3d1e989b31247bf7b /protocols/JabberG/src/jabber_menu.cpp | |
parent | ecbca42677af470d672e66d3f6950af208f8f212 (diff) |
LIST<>::indexOf(T**) - fast index calculation for direct iterators
Diffstat (limited to 'protocols/JabberG/src/jabber_menu.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_menu.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 02fc077c4f..9e0c556ba1 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -1067,11 +1067,10 @@ CJabberProto* JabberChooseInstance(bool bIsLink) return it;
int nItems = 0, lastItemId = 0;
- for (int i = 0; i < g_Instances.getCount(); i++) {
- CJabberProto *ppro = g_Instances[i];
+ for (auto &ppro : g_Instances) {
if (ppro->m_iStatus != ID_STATUS_OFFLINE && ppro->m_iStatus != ID_STATUS_CONNECTING) {
++nItems;
- lastItemId = i + 1;
+ lastItemId = g_Instances.indexOf(&ppro) + 1;
Menu_ModifyItem(ppro->m_hChooseMenuItem, nullptr, Skin_LoadProtoIcon(ppro->m_szModuleName, ppro->m_iStatus));
}
else Menu_ShowItem(ppro->m_hChooseMenuItem, false);
|