From bcb27264ba737778e5d3edad36088bacf74f0236 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 9 Apr 2013 20:03:46 +0000 Subject: - short function names allows to write database loops in one string; - 'continue' operator can be used then; - multiple bugs fixed in clists; - code becomes much more compact; git-svn-id: http://svn.miranda-ng.org/main/trunk@4403 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MRA/src/Mra_svcs.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'protocols/MRA/src/Mra_svcs.cpp') diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index 600331cff5..5e42aa4222 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -220,9 +220,7 @@ INT_PTR CMraProto::MraWebSearch(WPARAM wParam, LPARAM lParam) INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM wParam, LPARAM lParam) { if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateW(MRA_UPD_ALL_USERS_INFO_STR), MB_YESNO | MB_ICONQUESTION) == IDYES ) { - for (HANDLE hContact = db_find_first(); - hContact != NULL; - hContact = db_find_next(hContact)) { + for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { size_t dwEMailSize; CHAR szEMail[MAX_EMAIL_LEN]; if ( IsContactMra(hContact)) @@ -236,9 +234,7 @@ INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM wParam, LPARAM lParam) INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM wParam, LPARAM lParam) { if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateW(MRA_CHK_USERS_AVATARS_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) { - for (HANDLE hContact = db_find_first(); - hContact != NULL; - hContact = db_find_next(hContact)) { + for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { size_t dwEMailSize; CHAR szEMail[MAX_EMAIL_LEN]; @@ -254,9 +250,7 @@ INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM wParam, LPARAM lParam) INT_PTR CMraProto::MraRequestAuthForAll(WPARAM wParam, LPARAM lParam) { if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateW(MRA_REQ_AUTH_FOR_ALL_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) { - for (HANDLE hContact = db_find_first(); - hContact != NULL; - hContact = db_find_next(hContact)) { + for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { DWORD dwContactSeverFlags; if (GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwContactSeverFlags, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL) == NO_ERROR) if (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED && dwContactSeverFlags != -1) -- cgit v1.2.3