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/MSN/src/msn_contact.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'protocols/MSN/src/msn_contact.cpp') diff --git a/protocols/MSN/src/msn_contact.cpp b/protocols/MSN/src/msn_contact.cpp index bf9de7dbfd..ae5abebf9d 100644 --- a/protocols/MSN/src/msn_contact.cpp +++ b/protocols/MSN/src/msn_contact.cpp @@ -53,11 +53,7 @@ MCONTACT CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, MCONTACT CMsnProto::MSN_HContactFromChatID(const char* wlid) { - MCONTACT hContact = NULL; - - for (hContact = db_find_first(m_szModuleName); hContact; - hContact = db_find_next(hContact, m_szModuleName)) - { + for (auto &hContact : acc_contact_iter()) { if (isChatRoom(hContact) != 0) { DBVARIANT dbv; if (getString(hContact, "ChatRoomID", &dbv) == 0) { -- cgit v1.2.3