summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_thread.cpp
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2018-01-31 11:03:05 +0500
committerElzorFox <elzorfox@ya.ru>2018-01-31 11:03:05 +0500
commitb05eab27cf16f2316694d43211fb31827ceea727 (patch)
treebfeb5d39b0200d3ebb50198e9b201beb32bf5b9d /protocols/VKontakte/src/vk_thread.cpp
parentac25aecfd65f1e68677ca93e0f26138fd9dc6f3e (diff)
VKontakte: ะก++ 11 scope for
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index a9016dde16..d49242f3ea 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -606,8 +606,8 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
if (!isChatRoom(hContact) && !IsGroupUser(hContact))
arContacts.insert((HANDLE)hContact);
- for (auto it = jnUsers.begin(); it != jnUsers.end(); ++it) {
- hContact = SetContactInfo((*it));
+ for (auto &it : jnUsers) {
+ hContact = SetContactInfo(it);
if (hContact)
arContacts.remove((HANDLE)hContact);
}
@@ -642,8 +642,8 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
return;
debugLogA("CVkProto::OnReceiveUserInfo AuthRequests");
- for (auto it = jnItems.begin(); it != jnItems.end(); ++it) {
- LONG userid = (*it).as_int();
+ for (auto it : jnItems) {
+ LONG userid = it.as_int();
if (userid == 0)
break;
hContact = FindUser(userid, true);
@@ -668,9 +668,7 @@ void CVkProto::OnReceiveGroupInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR
if (!jnResponse)
return;
- for (auto it = jnResponse.begin(); it != jnResponse.end(); ++it) {
- const JSONNode &jnItem = (*it);
-
+ for (auto &jnItem : jnResponse) {
int iGroupId = (-1)*jnItem["id"].as_int();
bool bIsMember = jnItem["is_member"].as_bool();
@@ -769,8 +767,8 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq
const JSONNode &jnItems = jnResponse["items"];
if (jnItems)
- for (auto it = jnItems.begin(); it != jnItems.end(); ++it) {
- MCONTACT hContact = SetContactInfo((*it), true);
+ for (auto &it : jnItems) {
+ MCONTACT hContact = SetContactInfo(it, true);
if (hContact == 0 || hContact == INVALID_CONTACT_ID)
continue;