summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/communication.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-04 15:09:01 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-04 15:09:01 +0300
commit823e3839b108658811f689f959f51058effd82ac (patch)
treeb65b8618fb5c61c7e73cf8c0204cbd961a6b08c9 /protocols/FacebookRM/src/communication.cpp
parentd3f84250fdaa48e0ca1032b92b9c0f827707655b (diff)
ะก++'11 scope for's are suddenly more effective...
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r--protocols/FacebookRM/src/communication.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index 562f46b3a8..f07674b258 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -220,10 +220,10 @@ char* facebook_client::load_cookies()
std::string cookieString;
if (!cookies.empty())
- for (std::map< std::string, std::string >::iterator iter = cookies.begin(); iter != cookies.end(); ++iter) {
- cookieString.append(iter->first);
+ for (auto &iter : cookies) {
+ cookieString.append(iter.first);
cookieString.append(1, '=');
- cookieString.append(iter->second);
+ cookieString.append(iter.second);
cookieString.append(1, ';');
}
@@ -264,12 +264,11 @@ void facebook_client::clear_notifications()
{
ScopedLock s(notifications_lock_);
- for (auto it = notifications.begin(); it != notifications.end();) {
- if (it->second->hWndPopup != nullptr)
- PUDeletePopup(it->second->hWndPopup); // close popup
+ for (auto &it : notifications) {
+ if (it.second->hWndPopup != nullptr)
+ PUDeletePopup(it.second->hWndPopup); // close popup
- delete it->second;
- it = notifications.erase(it);
+ delete it.second;
}
notifications.clear();
@@ -277,10 +276,9 @@ void facebook_client::clear_notifications()
void facebook_client::clear_chatrooms()
{
- for (auto it = chat_rooms.begin(); it != chat_rooms.end();) {
- delete it->second;
- it = chat_rooms.erase(it);
- }
+ for (auto &it : chat_rooms)
+ delete it.second;
+
chat_rooms.clear();
}
@@ -289,12 +287,11 @@ void facebook_client::clear_chatrooms()
*/
void facebook_client::clear_readers()
{
- for (std::map<MCONTACT, time_t>::iterator it = readers.begin(); it != readers.end();) {
- if (parent->isChatRoom(it->first))
- parent->delSetting(it->first, FACEBOOK_KEY_MESSAGE_READERS);
+ for (auto &it : readers) {
+ if (parent->isChatRoom(it.first))
+ parent->delSetting(it.first, FACEBOOK_KEY_MESSAGE_READERS);
- parent->delSetting(it->first, FACEBOOK_KEY_MESSAGE_READ);
- it = readers.erase(it);
+ parent->delSetting(it.first, FACEBOOK_KEY_MESSAGE_READ);
}
readers.clear();
}