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/Spamotron/src/spamotron.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'plugins/Spamotron/src') diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index 9464ca0a32..10f4ec4dfb 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -484,9 +484,8 @@ void RemoveNotOnListSettings() { DBVARIANT dbv; char protoName[256] = { 0 }; - MCONTACT hContact = db_find_first(); mir_strcpy(protoName, "proto_"); - while (hContact != NULL) { + for (auto &hContact : contact_iter()) { if (db_get_s(hContact, "Protocol", "p", &dbv) == 0) { mir_strcat(protoName, dbv.pszVal); if (_getOptB(protoName, 0) != 0) { @@ -497,7 +496,6 @@ void RemoveNotOnListSettings() db_free(&dbv); } protoName[6] = 0; - hContact = db_find_next(hContact); } } -- cgit v1.2.3