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_opttree.cpp | |
parent | ecbca42677af470d672e66d3f6950af208f8f212 (diff) |
LIST<>::indexOf(T**) - fast index calculation for direct iterators
Diffstat (limited to 'protocols/JabberG/src/jabber_opttree.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_opttree.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp index c9ad4ba465..d4b0bfca13 100644 --- a/protocols/JabberG/src/jabber_opttree.cpp +++ b/protocols/JabberG/src/jabber_opttree.cpp @@ -107,12 +107,12 @@ void CCtrlTreeOpts::OnInit() SetImageList(hImgLst, TVSIL_NORMAL);
/* build options tree. based on code from IcoLib */
- for (int i = 0; i < m_options.getCount(); i++) {
+ for (auto &it : m_options) {
wchar_t *sectionName;
int sectionLevel = 0;
HTREEITEM hSection = nullptr;
- mir_wstrcpy(itemName, m_options[i]->m_szOptionName);
+ mir_wstrcpy(itemName, it->m_szOptionName);
sectionName = itemName;
while (sectionName) {
@@ -142,18 +142,18 @@ void CCtrlTreeOpts::OnInit() tvis.item.iImage = tvis.item.iSelectedImage = IMG_GRPOPEN;
}
else {
- tvis.item.lParam = i;
+ tvis.item.lParam = m_options.indexOf(&it);
- BYTE val = *m_options[i]->m_option;
+ BYTE val = *it->m_option;
- if (m_options[i]->m_groupId == OPTTREE_CHECK)
+ if (it->m_groupId == OPTTREE_CHECK)
tvis.item.iImage = tvis.item.iSelectedImage = val ? IMG_CHECK : IMG_NOCHECK;
else
tvis.item.iImage = tvis.item.iSelectedImage = val ? IMG_RCHECK : IMG_NORCHECK;
}
hItem = InsertItem(&tvis);
if (!sectionName)
- m_options[i]->m_hItem = hItem;
+ it->m_hItem = hItem;
}
}
sectionLevel++;
|