diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-21 18:33:08 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:14 +0300 |
commit | ba75602b16e4b9b484c2c05f70c117f612c81e1d (patch) | |
tree | c19e7066ece1d545437bd8482af888660e54e0d8 /plugins/Popup/src/notifications.cpp | |
parent | 95ce21d8512af00a4c5f607091a459b789f79b79 (diff) |
Popup+: C++'11 iterators
Diffstat (limited to 'plugins/Popup/src/notifications.cpp')
-rw-r--r-- | plugins/Popup/src/notifications.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index f5e904b3a4..7aaf6dc615 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -82,8 +82,8 @@ void FreePopupClass(POPUPTREEDATA *ptd) void UnloadTreeData()
{
- for (int i = 0; i < gTreeData.getCount(); ++i)
- FreePopupClass(gTreeData[i]);
+ for (auto &it : gTreeData)
+ FreePopupClass(it);
gTreeData.destroy();
}
@@ -213,11 +213,10 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) HANDLE FindTreeData(LPTSTR group, LPTSTR name, BYTE typ)
{
- for (int i = 0; i < gTreeData.getCount(); i++) {
- POPUPTREEDATA *p = gTreeData[i];
+ for (auto &p : gTreeData)
if (p->typ == typ && (!group || (mir_wstrcmp(p->pszTreeRoot, group) == 0)) && (!name || (mir_wstrcmp(p->pszDescription, name) == 0)))
return p;
- }
+
return nullptr;
}
|