diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-21 18:35:40 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:14 +0300 |
commit | 058282527241fe458a1aae28d565a727dcc1a811 (patch) | |
tree | 7b5d5a1a5abe8052cd9879af19135df5f58a363d /plugins/UserInfoEx/src/mir_db.cpp | |
parent | 429c0d0524e7197a593209468fef530344f5ee05 (diff) |
UInfoEx: C++'11 iterators
Diffstat (limited to 'plugins/UserInfoEx/src/mir_db.cpp')
-rw-r--r-- | plugins/UserInfoEx/src/mir_db.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index e4eb8bf2d2..f659d37637 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -65,8 +65,8 @@ void Delete(MCONTACT hContact, LPCSTR pszModule) {
CEnumList Settings;
if (!Settings.EnumSettings(hContact, pszModule))
- for (int i = 0; i < Settings.getCount(); i++)
- db_unset(hContact, pszModule, Settings[i]);
+ for (auto &it : Settings)
+ db_unset(hContact, pszModule, it);
}
/**
@@ -701,11 +701,8 @@ CEnumList::CEnumList() : LIST<CHAR>(50, CEnumList::CompareProc) CEnumList::~CEnumList()
{
- for (int i = 0, cnt = getCount(); i < cnt; i++) {
- LPSTR p = (*this)[i];
- if (p)
- mir_free(p);
- }
+ for (auto &it : *this)
+ mir_free(it);
}
LPSTR CEnumList::Insert(LPCSTR str)
|