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 --- plugins/NewAwaySysMod/src/SetAwayMsg.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'plugins/NewAwaySysMod/src/SetAwayMsg.cpp') diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index 26fb5a2db7..e953b125c3 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -878,9 +878,8 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA } } - MCONTACT hContact = db_find_first(); CList->SetRedraw(false); - do { + for (auto &hContact : contact_iter()) { char *szProto = GetContactProto(hContact); if (szProto) { int Flag1 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0); @@ -891,7 +890,6 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA } } } - while (hContact = db_find_next(hContact)); CList->SortContacts(); hItem = CLC_ROOT; -- cgit v1.2.3