diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-16 20:01:14 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-16 20:01:14 +0300 |
commit | 39390b02dbd5aa7eb21a83773fa561b39f8828bc (patch) | |
tree | 7982eda1257f7466b5663c2865fdb7804c397257 /plugins/DbEditorPP/src/deletemodule.cpp | |
parent | 5046973a41e412afd06d6a78a3b9bce226e3cf50 (diff) |
always hated these long expressions: contact_iter makes them much shorter
Diffstat (limited to 'plugins/DbEditorPP/src/deletemodule.cpp')
-rw-r--r-- | plugins/DbEditorPP/src/deletemodule.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp index 41b3a123ed..5d3104d233 100644 --- a/plugins/DbEditorPP/src/deletemodule.cpp +++ b/plugins/DbEditorPP/src/deletemodule.cpp @@ -46,7 +46,8 @@ void __cdecl PopulateModuleDropListThreadFunc(void *param) module = module->next;
continue;
}
- for (MCONTACT hContact = db_find_first(); moduleEmpty && hContact; hContact = db_find_next(hContact)) {
+
+ for (auto &hContact : contact_iter()) {
if (!IsModuleEmpty(hContact, module->name)) {
SendDlgItemMessageA(hwnd, IDC_CONTACTS, CB_ADDSTRING, 0, (LPARAM)module->name);
moduleEmpty = 0;
@@ -93,7 +94,7 @@ INT_PTR CALLBACK DeleteModuleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM) char module[FLD_SIZE];
GetDlgItemTextA(hwnd, IDC_CONTACTS, module, _countof(module));
SetCursor(LoadCursor(nullptr, IDC_WAIT));
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (auto &hContact : contact_iter())
deleteModule(hContact, module, 0);
// do the null
|