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/GmailNotifier/src/utility.cpp | |
parent | 9d0174ebe2bd005418855b18f737c36d5c20ab4a (diff) |
all another C++'11 iterators
Diffstat (limited to 'plugins/GmailNotifier/src/utility.cpp')
-rw-r--r-- | plugins/GmailNotifier/src/utility.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/GmailNotifier/src/utility.cpp b/plugins/GmailNotifier/src/utility.cpp index cadc6820db..840ff28a3c 100644 --- a/plugins/GmailNotifier/src/utility.cpp +++ b/plugins/GmailNotifier/src/utility.cpp @@ -19,12 +19,11 @@ void BuildList(void) }
}
- for (int i = 0; i < g_accs.getCount(); i++) {
- Account &acc = g_accs[i];
- char *tail = strchr(acc.name, '@');
+ for (auto &acc : g_accs) {
+ char *tail = strchr(acc->name, '@');
if (tail && mir_strcmp(tail + 1, "gmail.com") != 0)
- mir_strcpy(acc.hosted, tail + 1);
- acc.IsChecking = false;
+ mir_strcpy(acc->hosted, tail + 1);
+ acc->IsChecking = false;
}
}
@@ -70,9 +69,9 @@ BOOL GetBrowser(char *str) Account* GetAccountByContact(MCONTACT hContact)
{
- for (int i = 0; i < g_accs.getCount(); i++)
- if (g_accs[i].hContact == hContact)
- return &g_accs[i];
+ for (auto &it : g_accs)
+ if (it->hContact == hContact)
+ return it;
return nullptr;
}
|