summaryrefslogtreecommitdiff
path: root/plugins/BasicHistory
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-02-28 22:26:32 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-02-28 22:26:32 +0300
commit6b7f8c2129116382c8c67d05164110238845a1e0 (patch)
tree89f2361fcdcca5e9b1ad613de501f31856dcf2bd /plugins/BasicHistory
parentb2c82971f99a2e46cf9a0819ed86154d06d1f92a (diff)
some evident reverse iterators moved to cursors
Diffstat (limited to 'plugins/BasicHistory')
-rw-r--r--plugins/BasicHistory/src/HistoryWindow.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp
index 36ea44152a..353de121b9 100644
--- a/plugins/BasicHistory/src/HistoryWindow.cpp
+++ b/plugins/BasicHistory/src/HistoryWindow.cpp
@@ -391,11 +391,9 @@ INT_PTR HistoryWindow::DeleteAllUserHistory(WPARAM hContact, LPARAM)
return FALSE;
db_set_safety_mode(FALSE);
- MEVENT hDbEvent = db_event_last(hContact);
- while (hDbEvent != NULL) {
- MEVENT hPrevEvent = db_event_prev(hContact, hDbEvent);
- hDbEvent = (db_event_delete(hDbEvent) == 0) ? hPrevEvent : NULL;
- }
+ DB::ECPTR cursor(DB::Events(hContact));
+ while (cursor.FetchNext())
+ cursor.DeleteEvent();
db_set_safety_mode(TRUE);
if (HistoryEventList::IsImportedHistory(hContact)) {