From 6e96535fdbb886dcad1a3396659b368283922e64 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 21 Feb 2018 18:36:32 +0300 Subject: Jabber: C++'11 iterators --- protocols/JabberG/src/jabber_privacy.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'protocols/JabberG/src/jabber_privacy.cpp') diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index f189e90b17..4e37896abd 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -651,9 +651,9 @@ protected: TCLCInfo(): newJids(1, TJidData::cmp), bChanged(false), pList(nullptr) {} ~TCLCInfo() { - for (int i=0; i < newJids.getCount(); i++) { - mir_free(newJids[i]->jid); - mir_free(newJids[i]); + for (auto &it : newJids) { + mir_free(it->jid); + mir_free(it); } } @@ -1367,8 +1367,8 @@ void CJabberDlgPrivacyLists::CListApplyList(HWND hwndList, CPrivacyList *pList) CListResetIcons(hwndList, hItem, bHideIcons); } - for (int iJid = 0; iJid < clc_info.newJids.getCount(); ++iJid) - CListResetIcons(hwndList, clc_info.newJids[iJid]->hItem, bHideIcons); + for (auto &it : clc_info.newJids) + CListResetIcons(hwndList, it->hItem, bHideIcons); if (!pList) goto lbl_return; @@ -1449,9 +1449,9 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList) pList->RemoveAllRules(); - for (int iJid = 0; iJid < clc_info.newJids.getCount(); ++iJid) { - hItem = clc_info.newJids[iJid]->hItem; - szJid = clc_info.newJids[iJid]->jid; + for (auto &it : clc_info.newJids) { + hItem = it->hItem; + szJid = it->jid; if (dwPackets = CListGetPackets(hwndList, hItem, true)) pList->AddRule(Jid, szJid, TRUE, dwOrder++, dwPackets); @@ -2111,8 +2111,8 @@ void CJabberProto::BuildPrivacyMenu() void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) { if (bDeleteOld) - for (int i = 0; i < m_hPrivacyMenuItems.getCount(); i++) - Menu_RemoveItem((HGENMENU)m_hPrivacyMenuItems[i]); + for (auto &it : m_hPrivacyMenuItems) + Menu_RemoveItem((HGENMENU)it); m_hPrivacyMenuItems.destroy(); -- cgit v1.2.3