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/AutoShutdown/src/watcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/AutoShutdown/src/watcher.cpp') diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 04f8429eb0..768f85bb74 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -176,7 +176,7 @@ static BOOL CheckAllContactsOffline(void) { BOOL fSmartCheck, fAllOffline = TRUE; /* tentatively */ fSmartCheck = db_get_b(NULL, "AutoShutdown", "SmartOfflineCheck", SETTING_SMARTOFFLINECHECK_DEFAULT); - for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (auto &hContact : contact_iter()) { char *pszProto = GetContactProto(hContact); if (pszProto != nullptr && CallProtoService(pszProto, PS_GETSTATUS, 0, 0) != ID_STATUS_OFFLINE) { if (db_get_b(hContact, pszProto, "ChatRoom", 0)) continue; -- cgit v1.2.3