diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:03 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:14 +0300 |
commit | 477a6ea70d0bb1b1dfe9cbd9a15b6dad0284ddeb (patch) | |
tree | 247eed13a5231c3983e343f0b7fc2a95012353c2 /plugins/SecureIM/src/crypt_lists.cpp | |
parent | 9d0174ebe2bd005418855b18f737c36d5c20ab4a (diff) |
all another C++'11 iterators
Diffstat (limited to 'plugins/SecureIM/src/crypt_lists.cpp')
-rw-r--r-- | plugins/SecureIM/src/crypt_lists.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/plugins/SecureIM/src/crypt_lists.cpp b/plugins/SecureIM/src/crypt_lists.cpp index bb97d160f0..be5f6a5e0a 100644 --- a/plugins/SecureIM/src/crypt_lists.cpp +++ b/plugins/SecureIM/src/crypt_lists.cpp @@ -56,9 +56,9 @@ void loadSupportedProtocols() void freeSupportedProtocols()
{
- for (int j = 0; j < arProto.getCount(); j++) {
- mir_free(arProto[j]->name);
- mir_free(arProto[j]);
+ for (auto &it : arProto) {
+ mir_free(it->name);
+ mir_free(it);
}
arProto.destroy();
@@ -66,9 +66,9 @@ void freeSupportedProtocols() pSupPro getSupPro(MCONTACT hContact)
{
- for (int j = 0; j < arProto.getCount(); j++)
- if (Proto_IsProtoOnContact(hContact, arProto[j]->name))
- return arProto[j];
+ for (auto &it : arProto)
+ if (Proto_IsProtoOnContact(hContact, it->name))
+ return it;
return nullptr;
}
@@ -127,8 +127,7 @@ void loadContactList() // free list of secureIM users
void freeContactList()
{
- for (int j = 0; j < arClist.getCount(); j++) {
- pUinKey p = arClist[j];
+ for (auto &p : arClist) {
cpp_delete_context(p->cntx); p->cntx = nullptr;
mir_free(p->tmp);
mir_free(p->msgSplitted);
@@ -153,9 +152,9 @@ pUinKey getUinKey(MCONTACT hContact) pUinKey getUinCtx(HANDLE cntx)
{
- for (int j = 0; j < arClist.getCount(); j++)
- if (arClist[j]->cntx == cntx)
- return arClist[j];
+ for (auto &it : arClist)
+ if (it->cntx == cntx)
+ return it;
return nullptr;
}
|