diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-21 18:37:12 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:14 +0300 |
commit | b6de8047c1113030b64c81e58c2ba37c062639ae (patch) | |
tree | 046dbb4cf9e8cd2f904fef38ca86e00304605ac8 /protocols/SkypeWeb/src/requests | |
parent | 40dc4c27f7d2ea66ff570281a992415a0e6578a2 (diff) |
Skype: C++'11 iterators
Diffstat (limited to 'protocols/SkypeWeb/src/requests')
-rw-r--r-- | protocols/SkypeWeb/src/requests/chatrooms.h | 6 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/requests/contacts.h | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/requests/subscriptions.h | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/protocols/SkypeWeb/src/requests/chatrooms.h b/protocols/SkypeWeb/src/requests/chatrooms.h index feb6461e60..607dd462d1 100644 --- a/protocols/SkypeWeb/src/requests/chatrooms.h +++ b/protocols/SkypeWeb/src/requests/chatrooms.h @@ -97,12 +97,12 @@ public: JSONNode node;
JSONNode members(JSON_ARRAY); members.set_name("members");
- for (int i = 0; i < skypenames.getCount(); i++)
+ for (auto &it : skypenames)
{
JSONNode member;
member
- << JSONNode("id", CMStringA(::FORMAT, "8:%s", skypenames[i]).GetBuffer())
- << JSONNode("role", !mir_strcmpi(skypenames[i], li.szSkypename) ? "Admin" : "User");
+ << JSONNode("id", CMStringA(::FORMAT, "8:%s", it).GetBuffer())
+ << JSONNode("role", !mir_strcmpi(it, li.szSkypename) ? "Admin" : "User");
members << member;
}
node << members;
diff --git a/protocols/SkypeWeb/src/requests/contacts.h b/protocols/SkypeWeb/src/requests/contacts.h index 39c0278508..40edfcc63d 100644 --- a/protocols/SkypeWeb/src/requests/contacts.h +++ b/protocols/SkypeWeb/src/requests/contacts.h @@ -45,8 +45,8 @@ public: << CHAR_VALUE("X-Skypetoken", li.api.szToken)
<< CHAR_VALUE("Accept", "application/json");
- for (int i = 0; i < skypenames.getCount(); i++)
- Body << CHAR_VALUE("contacts[]", skypenames[i]);
+ for (auto &it : skypenames)
+ Body << CHAR_VALUE("contacts[]", it);
}
};
diff --git a/protocols/SkypeWeb/src/requests/subscriptions.h b/protocols/SkypeWeb/src/requests/subscriptions.h index 5b3ea7c4d2..6075228a4e 100644 --- a/protocols/SkypeWeb/src/requests/subscriptions.h +++ b/protocols/SkypeWeb/src/requests/subscriptions.h @@ -61,10 +61,10 @@ public: JSONNode node;
JSONNode contacts(JSON_ARRAY); contacts.set_name("contacts");
- for (int i = 0; i < skypenames.getCount(); i++)
+ for (auto &it : skypenames)
{
JSONNode contact;
- contact << JSONNode("id", CMStringA(::FORMAT, "8:%s", skypenames[i]));
+ contact << JSONNode("id", CMStringA(::FORMAT, "8:%s", it));
contacts << contact;
}
node << contacts;
|