summaryrefslogtreecommitdiff
path: root/plugins/Spamotron
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-16 20:01:14 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-16 20:01:14 +0300
commit39390b02dbd5aa7eb21a83773fa561b39f8828bc (patch)
tree7982eda1257f7466b5663c2865fdb7804c397257 /plugins/Spamotron
parent5046973a41e412afd06d6a78a3b9bce226e3cf50 (diff)
always hated these long expressions: contact_iter makes them much shorter
Diffstat (limited to 'plugins/Spamotron')
-rw-r--r--plugins/Spamotron/src/spamotron.cpp4
1 files changed, 1 insertions, 3 deletions
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);
}
}