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/Scriver/src/chat_manager.cpp | 3 +-- plugins/Scriver/src/msgs.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'plugins/Scriver/src') diff --git a/plugins/Scriver/src/chat_manager.cpp b/plugins/Scriver/src/chat_manager.cpp index c763f15e6a..0995b28b74 100644 --- a/plugins/Scriver/src/chat_manager.cpp +++ b/plugins/Scriver/src/chat_manager.cpp @@ -31,8 +31,7 @@ SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO *cu if (currSession == prevSession) pszCurrent = pszOriginal; - for (int i = 0; i < pci->arSessions.getCount(); i++) { - SESSION_INFO *si = pci->arSessions[i]; + for (auto &si : pci->arSessions) { if (si != currSession && !mir_strcmpi(pszModule, si->pszModule)) { if (my_strstri(si->ptszName, pszOriginal) == si->ptszName) { if (prevSession != si && mir_wstrcmpi(si->ptszName, pszCurrent) > 0 && (!pszName || mir_wstrcmpi(si->ptszName, pszName) < 0)) { diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index e713c569cc..7e0ddb8a4f 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -276,11 +276,10 @@ static void RestoreUnreadMessageAlerts(void) cle.flags = CLEF_UNICODE; cle.szTooltip.w = toolTip; - for (int i = 0; i < arEvents.getCount(); i++) { - MSavedEvent &e = arEvents[i]; - mir_snwprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0)); - cle.hContact = e.hContact; - cle.hDbEvent = e.hEvent; + for (auto &e : arEvents) { + mir_snwprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e->hContact, 0)); + cle.hContact = e->hContact; + cle.hDbEvent = e->hEvent; pcli->pfnAddEvent(&cle); } } -- cgit v1.2.3