diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-21 18:36:45 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:14 +0300 |
commit | e8f69d4e566a3e73ff656beebcae9916e9148589 (patch) | |
tree | 1609c337a76dd79d198fecfdfa5d3acfbd2c45cf /protocols/MSN/src/msn_srv.cpp | |
parent | 6e96535fdbb886dcad1a3396659b368283922e64 (diff) |
MSN: C++'11 iterators
Diffstat (limited to 'protocols/MSN/src/msn_srv.cpp')
-rw-r--r-- | protocols/MSN/src/msn_srv.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/protocols/MSN/src/msn_srv.cpp b/protocols/MSN/src/msn_srv.cpp index 4d4a239c52..a3e5181f73 100644 --- a/protocols/MSN/src/msn_srv.cpp +++ b/protocols/MSN/src/msn_srv.cpp @@ -84,8 +84,7 @@ void CMsnProto::MSN_DeleteServerGroup(LPCSTR szId) void CMsnProto::MSN_FreeGroups(void)
{
- for (int i = 0; i < m_arGroups.getCount(); i++) {
- ServerGroupItem* p = m_arGroups[i];
+ for (auto &p : m_arGroups) {
mir_free(p->id);
mir_free(p->name);
mir_free(p);
@@ -107,11 +106,9 @@ LPCSTR CMsnProto::MSN_GetGroupById(const char* pId) LPCSTR CMsnProto::MSN_GetGroupByName(const char* pName)
{
- for (int i = 0; i < m_arGroups.getCount(); i++) {
- const ServerGroupItem* p = m_arGroups[i];
+ for (auto &p : m_arGroups)
if (mir_strcmp(p->name, pName) == 0)
return p->id;
- }
return nullptr;
}
|