From b05eab27cf16f2316694d43211fb31827ceea727 Mon Sep 17 00:00:00 2001 From: ElzorFox Date: Wed, 31 Jan 2018 11:03:05 +0500 Subject: =?UTF-8?q?VKontakte:=20=D0=A1++=2011=20scope=20for?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/VKontakte/src/vk_feed.cpp | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'protocols/VKontakte/src/vk_feed.cpp') diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index 6920e73f28..67502aee15 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -122,8 +122,7 @@ void CVkProto::CreateVkUserInfoList(OBJLIST &vkUsers, const JSONNod const JSONNode &jnProfiles = jnResponse["profiles"]; if (jnProfiles) - for (auto it = jnProfiles.begin(); it != jnProfiles.end(); ++it) { - const JSONNode &jnProfile = (*it); + for (auto &jnProfile : jnProfiles) { if (!jnProfile["id"]) continue; LONG UserId = jnProfile["id"].as_int(); @@ -142,8 +141,7 @@ void CVkProto::CreateVkUserInfoList(OBJLIST &vkUsers, const JSONNod const JSONNode &jnGroups = jnResponse["groups"]; if (jnGroups) - for (auto it = jnGroups.begin(); it != jnGroups.end(); ++it) { - const JSONNode &jnProfile = (*it); + for (auto &jnProfile : jnGroups) { if (!jnProfile["id"]) continue; LONG UserId = -jnProfile["id"].as_int(); @@ -189,8 +187,8 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLISTwszType == L"wall_photo") { if (jnPhotoItem["post_id"]) { @@ -301,8 +298,7 @@ CMStringW CVkProto::GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedba const JSONNode &jnUsers = jnFeedback["items"]; CMStringW wszUsers; - for (auto it = jnUsers.begin(); it != jnUsers.end(); ++it) { - const JSONNode &jnUserItem = (*it); + for (auto &jnUserItem : jnUsers) { if (!jnUserItem["from_id"]) continue; iUserId = jnUserItem["from_id"].as_int(); @@ -513,8 +509,7 @@ void CVkProto::OnFriendAccepted(const JSONNode & jnFeedback) { const JSONNode &jnUsers = jnFeedback["items"]; - for (auto it = jnUsers.begin(); it != jnUsers.end(); ++it) { - const JSONNode &jnUserItem = (*it); + for (auto &jnUserItem : jnUsers) { if (!jnUserItem["from_id"]) continue; @@ -668,8 +663,8 @@ void CVkProto::OnReceiveUnreadNews(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *p OBJLIST vkNews(5, sttCompareVKNewsItems); if (jnItems) - for (auto it = jnItems.begin(); it != jnItems.end(); ++it) { - CVKNewsItem *vkNewsItem = GetVkNewsItem((*it), vkUsers); + for (auto &it : jnItems) { + CVKNewsItem *vkNewsItem = GetVkNewsItem(it, vkUsers); if (!vkNewsItem) continue; CVKNewsItem *vkNewsFoundItem = vkNews.find(vkNewsItem); @@ -779,8 +774,8 @@ void CVkProto::OnReceiveUnreadNotifications(NETLIBHTTPREQUEST *reply, AsyncHttpR const JSONNode &jnItems = jnNotifications["items"]; if (jnItems) - for (auto it = jnItems.begin(); it != jnItems.end(); ++it) { - CVKNewsItem *vkNotificationItem = GetVkNotificationsItem((*it), vkUsers); + for (auto &it : jnItems) { + CVKNewsItem *vkNotificationItem = GetVkNotificationsItem(it, vkUsers); if (!vkNotificationItem) continue; if (vkNotification.find(vkNotificationItem) == nullptr) @@ -794,8 +789,8 @@ void CVkProto::OnReceiveUnreadNotifications(NETLIBHTTPREQUEST *reply, AsyncHttpR const JSONNode &jnItems = jnGroupInvates["items"]; if (jnItems) - for (auto it = jnItems.begin(); it != jnItems.end(); ++it) { - CVKNewsItem *vkNotificationItem = GetVkGroupInvates((*it), vkUsers); + for (auto &it : jnItems) { + CVKNewsItem *vkNotificationItem = GetVkGroupInvates(it, vkUsers); if (!vkNotificationItem) continue; if (vkNotification.find(vkNotificationItem) == nullptr) -- cgit v1.2.3