summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/mir_db.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-02-21 18:35:40 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-02-21 18:40:14 +0300
commit058282527241fe458a1aae28d565a727dcc1a811 (patch)
tree7b5d5a1a5abe8052cd9879af19135df5f58a363d /plugins/UserInfoEx/src/mir_db.cpp
parent429c0d0524e7197a593209468fef530344f5ee05 (diff)
UInfoEx: C++'11 iterators
Diffstat (limited to 'plugins/UserInfoEx/src/mir_db.cpp')
-rw-r--r--plugins/UserInfoEx/src/mir_db.cpp11
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)