From 477a6ea70d0bb1b1dfe9cbd9a15b6dad0284ddeb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 21 Feb 2018 18:40:03 +0300 Subject: all another C++'11 iterators --- plugins/GmailNotifier/src/utility.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'plugins/GmailNotifier/src/utility.cpp') 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; } -- cgit v1.2.3