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 --- protocols/FacebookRM/src/messages.cpp | 4 ++-- protocols/FacebookRM/src/stdafx.h | 4 ++-- protocols/FacebookRM/src/theme.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'protocols/FacebookRM/src') diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp index 263f33a462..b502a1f471 100644 --- a/protocols/FacebookRM/src/messages.cpp +++ b/protocols/FacebookRM/src/messages.cpp @@ -320,8 +320,8 @@ HttpRequest* facebook_client::markMessageReadRequest(const LIST &ids) p->Url << INT_PARAM("__a", 1); - for (int i = 0; i < ids.getCount(); i++) { - std::string id_ = ids[i]; + for (auto &it : ids) { + std::string id_ = it; // NOTE: Remove "id." prefix as here we need to give threadFbId and not threadId if (id_.substr(0, 3) == "id.") id_ = id_.substr(3); diff --git a/protocols/FacebookRM/src/stdafx.h b/protocols/FacebookRM/src/stdafx.h index 83efa47cf7..ea411d908f 100644 --- a/protocols/FacebookRM/src/stdafx.h +++ b/protocols/FacebookRM/src/stdafx.h @@ -86,6 +86,6 @@ extern DWORD g_mirandaVersion; template __inline static void FreeList(const LIST &lst) { - for (int i = 0; i < lst.getCount(); i++) - mir_free(lst[i]); + for (auto &it : lst) + mir_free(it); } \ No newline at end of file diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index 70c0835308..91d7931076 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -75,9 +75,9 @@ static FacebookProto * GetInstanceByHContact(MCONTACT hContact) if (!proto) return nullptr; - for (int i = 0; i < g_Instances.getCount(); i++) - if (!mir_strcmp(proto, g_Instances[i].m_szModuleName)) - return &g_Instances[i]; + for (auto &it : g_Instances) + if (!mir_strcmp(proto, it->m_szModuleName)) + return it; return nullptr; } -- cgit v1.2.3