From 823e3839b108658811f689f959f51058effd82ac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 4 Jan 2018 15:09:01 +0300 Subject: =?UTF-8?q?=D0=A1++'11=20scope=20for's=20are=20suddenly=20more=20e?= =?UTF-8?q?ffective...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/FacebookRM/src/chat.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'protocols/FacebookRM/src/chat.cpp') diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index 335b9e281a..7b5a0d7935 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -260,8 +260,8 @@ INT_PTR FacebookProto::OnJoinChat(WPARAM hContact, LPARAM) AddChat(fbc->thread_id.c_str(), fbc->chat_name.c_str()); // Add chat contacts - for (std::map::iterator jt = fbc->participants.begin(); jt != fbc->participants.end(); ++jt) - AddChatContact(fbc->thread_id.c_str(), jt->second, false); + for (auto &jt : fbc->participants) + AddChatContact(fbc->thread_id.c_str(), jt.second, false); // Load last messages delSetting(hContact, FACEBOOK_KEY_MESSAGE_ID); // We're creating new chatroom so we want load all recent messages @@ -393,11 +393,11 @@ std::string FacebookProto::GenerateChatName(facebook_chatroom *fbc) std::string name = ""; unsigned int namesUsed = 0; - for (auto it = fbc->participants.begin(); it != fbc->participants.end(); ++it) { - std::string participant = it->second.nick; + for (auto &it : fbc->participants) { + std::string participant = it.second.nick; // Ignore self contact, empty and numeric only participant names - if (it->second.role == ROLE_ME || participant.empty() || participant.find_first_not_of("0123456789") == std::string::npos) + if (it.second.role == ROLE_ME || participant.empty() || participant.find_first_not_of("0123456789") == std::string::npos) continue; if (namesUsed > 0) -- cgit v1.2.3