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/IRCG/src/commandmonitor.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'protocols/IRCG/src/commandmonitor.cpp') diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index a38c11fe2a..e91473722a 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -139,12 +139,9 @@ VOID CALLBACK OnlineNotifTimerProc( HWND, UINT, UINT_PTR idEvent, DWORD ) if ( name.IsEmpty() && name2.IsEmpty()) { DBVARIANT dbv; - char* szProto; - - HANDLE hContact = db_find_first(); - while ( hContact ) { - szProto = GetContactProto(hContact); - if ( szProto != NULL && !lstrcmpiA( szProto, ppro->m_szModuleName )) { + for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + char *szProto = GetContactProto(hContact); + if (szProto != NULL && !lstrcmpiA( szProto, ppro->m_szModuleName)) { BYTE bRoom = ppro->getByte(hContact, "ChatRoom", 0); if ( bRoom == 0 ) { BYTE bDCC = ppro->getByte(hContact, "DCC", 0); @@ -177,10 +174,7 @@ VOID CALLBACK OnlineNotifTimerProc( HWND, UINT, UINT_PTR idEvent, DWORD ) if ( DBNick ) db_free(&dbv); if ( DBWildcard ) db_free(&dbv2); - } } } } } - - hContact = db_find_next(hContact); - } } + } } } } } } } if ( ppro->m_namesToWho.IsEmpty() && ppro->m_namesToUserhost.IsEmpty()) { ppro->SetChatTimer( ppro->OnlineNotifTimer, 60*1000, OnlineNotifTimerProc ); -- cgit v1.2.3