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/Variables/src/contact.cpp | |
parent | 9d0174ebe2bd005418855b18f737c36d5c20ab4a (diff) |
all another C++'11 iterators
Diffstat (limited to 'plugins/Variables/src/contact.cpp')
-rw-r--r-- | plugins/Variables/src/contact.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 270ae015b8..8574cea41f 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -317,22 +317,21 @@ static int contactSettingChanged(WPARAM hContact, LPARAM lParam) bool isUid = (((INT_PTR)uid != CALLSERVICE_NOTFOUND) && (uid != nullptr)) && (!strcmp(dbw->szSetting, uid));
mir_cslock lck(csContactCache);
- for (int i = 0; i < arContactCache.getCount(); i++) {
- CONTACTCE &cce = arContactCache[i];
- if (hContact != cce.hContact && (cce.flags & CI_CNFINFO) == 0)
+ for (auto &it : arContactCache) {
+ if (hContact != it->hContact && (it->flags & CI_CNFINFO) == 0)
continue;
- if ((isNick && (cce.flags & CI_NICK)) ||
- (isFirstName && (cce.flags & CI_FIRSTNAME)) ||
- (isLastName && (cce.flags & CI_LASTNAME)) ||
- (isEmail && (cce.flags & CI_EMAIL)) ||
- (isMyHandle && (cce.flags & CI_LISTNAME)) ||
- (cce.flags & CI_CNFINFO) != 0 || // lazy; always invalidate CNF info cache entries
- (isUid && (cce.flags & CI_UNIQUEID)))
+ if ((isNick && (it->flags & CI_NICK)) ||
+ (isFirstName && (it->flags & CI_FIRSTNAME)) ||
+ (isLastName && (it->flags & CI_LASTNAME)) ||
+ (isEmail && (it->flags & CI_EMAIL)) ||
+ (isMyHandle && (it->flags & CI_LISTNAME)) ||
+ (it->flags & CI_CNFINFO) != 0 || // lazy; always invalidate CNF info cache entries
+ (isUid && (it->flags & CI_UNIQUEID)))
{
/* remove from cache */
- mir_free(cce.tszContact);
- arContactCache.remove(i);
+ mir_free(it->tszContact);
+ arContactCache.remove(it);
break;
}
}
@@ -347,8 +346,8 @@ int initContactModule() int deinitContactModule()
{
- for (int i = 0; i < arContactCache.getCount(); i++)
- mir_free(arContactCache[i].tszContact);
+ for (auto &it : arContactCache)
+ mir_free(it->tszContact);
arContactCache.destroy();
return 0;
}
|