From 39390b02dbd5aa7eb21a83773fa561b39f8828bc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Mar 2018 20:01:14 +0300 Subject: always hated these long expressions: contact_iter makes them much shorter --- protocols/FacebookRM/src/contacts.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'protocols/FacebookRM/src/contacts.cpp') diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index be4c056871..889b042fa3 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -90,7 +90,7 @@ MCONTACT FacebookProto::ChatIDToHContact(const std::string &chat_id) } // Go through all local contacts - for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (auto &hContact : acc_contact_iter()) { if (!IsMyContact(hContact, true)) continue; @@ -122,7 +122,7 @@ MCONTACT FacebookProto::ContactIDToHContact(const std::string &user_id) } // Go through all local contacts - for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (auto &hContact : acc_contact_iter()) { if (isChatRoom(hContact)) continue; @@ -150,7 +150,7 @@ std::string FacebookProto::ThreadIDToContactID(const std::string &thread_id) } // Go through all local contacts - for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (auto &hContact : acc_contact_iter()) { if (!IsMyContact(hContact)) continue; -- cgit v1.2.3