summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbcontacts.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-02-23 17:52:24 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-02-23 17:52:24 +0000
commit0c4bed1db819569b8d0e0e2e4cffdb070d221230 (patch)
tree139045cbb28a43711486bff2052509f55b8f6a94 /plugins/Dbx_mdb/src/dbcontacts.cpp
parent6beffb019a4672a7fb21564764d8e4ccd244720d (diff)
small optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@16330 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbcontacts.cpp')
-rw-r--r--plugins/Dbx_mdb/src/dbcontacts.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/plugins/Dbx_mdb/src/dbcontacts.cpp b/plugins/Dbx_mdb/src/dbcontacts.cpp
index aa5c8a6f9d..b59e69fe47 100644
--- a/plugins/Dbx_mdb/src/dbcontacts.cpp
+++ b/plugins/Dbx_mdb/src/dbcontacts.cpp
@@ -106,25 +106,12 @@ STDMETHODIMP_(LONG) CDbxMdb::DeleteContact(MCONTACT contactID)
break;
}
{
- LIST<void> events(50, NumericKeySortT);
- {
- DBEventSortingKey keyVal = { 0, 0, contactID };
- key.mv_size = sizeof(keyVal); key.mv_data = &keyVal;
-
- txn_ptr_ro txn(m_txn);
- cursor_ptr_ro cursor(m_curEventsSort);
- mdb_cursor_get(cursor, &key, &data, MDB_SET);
- while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == MDB_SUCCESS)
- {
- DBEventSortingKey *pKey = (DBEventSortingKey*)key.mv_data;
- if (pKey->dwContactId != contactID)
- break;
- events.insert((void*)pKey->dwEventId);
- }
- }
+ LIST<EventItem> events(50);
+ GatherContactHistory(contactID, events);
while (events.getCount())
{
- DeleteEvent(contactID, (MEVENT)events[0]);
+ DeleteEvent(contactID, events[0]->eventId);
+ delete events[0];
events.remove(0);
}
}