From 8343b85b097da18cc7d4b17e598f2d5a9003a7fe Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 7 Dec 2020 12:42:40 +0300 Subject: useless code removed --- plugins/Dbx_mdbx/src/dbcontacts.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'plugins/Dbx_mdbx/src/dbcontacts.cpp') diff --git a/plugins/Dbx_mdbx/src/dbcontacts.cpp b/plugins/Dbx_mdbx/src/dbcontacts.cpp index 1ae91069b2..47a23254c4 100644 --- a/plugins/Dbx_mdbx/src/dbcontacts.cpp +++ b/plugins/Dbx_mdbx/src/dbcontacts.cpp @@ -68,9 +68,6 @@ LONG CDbxMDBX::DeleteContact(MCONTACT contactID) mdbx_del(trnlck, m_dbEvents, &key2, nullptr); } } - - if (trnlck.Commit() != MDBX_SUCCESS) - return 1; } // remove all contact's settings @@ -90,9 +87,6 @@ LONG CDbxMDBX::DeleteContact(MCONTACT contactID) if (mdbx_cursor_del(cursor, MDBX_UPSERT) != MDBX_SUCCESS) return 1; } - - if (trnlck.Commit() != MDBX_SUCCESS) - return 1; } // finally remove the contact itself @@ -102,8 +96,6 @@ LONG CDbxMDBX::DeleteContact(MCONTACT contactID) txn_ptr trnlck(this); if (mdbx_del(trnlck, m_dbContacts, &key, nullptr) != MDBX_SUCCESS) return 1; - if (trnlck.Commit() != MDBX_SUCCESS) - return 1; } // free cache item @@ -124,8 +116,6 @@ MCONTACT CDbxMDBX::AddContact() txn_ptr trnlck(this); if (mdbx_put(trnlck, m_dbContacts, &key, &data, MDBX_UPSERT) != MDBX_SUCCESS) return 0; - if (trnlck.Commit() != MDBX_SUCCESS) - return 0; } DBFlush(); @@ -171,9 +161,6 @@ BOOL CDbxMDBX::MetaMergeHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) if (mdbx_put(trnlck, m_dbEventsSort, &key, &data, MDBX_UPSERT) != MDBX_SUCCESS) return 1; - if (trnlck.Commit() != MDBX_SUCCESS) - return 1; - ccMeta->dbc.dwEventCount++; } { @@ -182,8 +169,6 @@ BOOL CDbxMDBX::MetaMergeHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) txn_ptr trnlck(this); if (mdbx_put(trnlck, m_dbContacts, &keyc, &datac, MDBX_UPSERT) != MDBX_SUCCESS) return 1; - if (trnlck.Commit() != MDBX_SUCCESS) - return 1; } DBFlush(); @@ -203,8 +188,6 @@ BOOL CDbxMDBX::MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) MDBX_val key = { &insVal, sizeof(insVal) }; if (mdbx_del(trnlck, m_dbEventsSort, &key, nullptr) != MDBX_SUCCESS) return 1; - if (trnlck.Commit() != MDBX_SUCCESS) - return 1; ccMeta->dbc.dwEventCount--; } @@ -213,8 +196,6 @@ BOOL CDbxMDBX::MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) MDBX_val keyc = { &ccMeta->contactID, sizeof(MCONTACT) }, datac = { &ccMeta->dbc, sizeof(ccMeta->dbc) }; if (mdbx_put(trnlck, m_dbContacts, &keyc, &datac, MDBX_UPSERT) != MDBX_SUCCESS) return 1; - if (trnlck.Commit() != MDBX_SUCCESS) - return 1; } DBFlush(); @@ -246,9 +227,6 @@ BOOL CDbxMDBX::MetaRemoveSubHistory(DBCachedContact *ccSub) if (mdbx_del(trnlck, m_dbEventsSort, &key, nullptr) != MDBX_SUCCESS) return 1; } - - if (trnlck.Commit() != MDBX_SUCCESS) - return 1; } DBFlush(); -- cgit v1.2.3