summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbcontacts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_mdb/src/dbcontacts.cpp')
-rw-r--r--plugins/Dbx_mdb/src/dbcontacts.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/plugins/Dbx_mdb/src/dbcontacts.cpp b/plugins/Dbx_mdb/src/dbcontacts.cpp
index 2645a12db2..629790ea61 100644
--- a/plugins/Dbx_mdb/src/dbcontacts.cpp
+++ b/plugins/Dbx_mdb/src/dbcontacts.cpp
@@ -286,12 +286,12 @@ void DBCachedContact::Advance(DWORD id, DBEvent &dbe)
void DBCachedContact::Snapshot()
{
- memcpy(&tmp_dbc, &dbc, sizeof(dbc));
+ tmp_dbc = dbc;
}
void DBCachedContact::Revert()
{
- memcpy(&dbc, &tmp_dbc, sizeof(dbc));
+ dbc = tmp_dbc;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -301,26 +301,15 @@ void CDbxMdb::FillContacts()
{
LIST<DBCachedContact> arContacts(m_contactCount);
- {
- txn_ptr_ro trnlck(m_txn);
- cursor_ptr_ro cursor(m_curContacts);
-
- MDB_val key, data;
- while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == MDB_SUCCESS)
- {
- const DBContact *dbc = (const DBContact*)data.mv_data;
-
- DBCachedContact *cc = m_cache->AddContactToCache(*(MCONTACT*)key.mv_data);
- cc->dbc.dwEventCount = dbc->dwEventCount;
- cc->dbc.dwFirstUnread = dbc->dwFirstUnread;
- cc->dbc.tsFirstUnread = dbc->tsFirstUnread;
- arContacts.insert(cc);
- }
- }
+ txn_ptr_ro trnlck(m_txn);
+ cursor_ptr_ro cursor(m_curContacts);
- for (int i = 0; i < arContacts.getCount(); i++)
+ MDB_val key, data;
+ while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == MDB_SUCCESS)
{
- DBCachedContact *cc = arContacts[i];
+ DBCachedContact *cc = m_cache->AddContactToCache(*(MCONTACT*)key.mv_data);
+ cc->dbc = *(DBContact*)data.mv_data;
+
CheckProto(cc, "");
DBVARIANT dbv; dbv.type = DBVT_DWORD;