diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-19 15:39:36 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-19 15:39:36 +0000 |
commit | bb9b9046f5749d13f83b3c2fe8a47b6d3fd6994e (patch) | |
tree | 16042555d69124dab843d8719c6b1cc93b5a7e4d /plugins/Dbx_mdb/src/dbevents.cpp | |
parent | cf751286442fa9b4b4843ae1091625e6a6c7ba2d (diff) |
dbx_lmdb: speed optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@16311 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbevents.cpp')
-rw-r--r-- | plugins/Dbx_mdb/src/dbevents.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/Dbx_mdb/src/dbevents.cpp b/plugins/Dbx_mdb/src/dbevents.cpp index 39ec4d4afb..af81195ff7 100644 --- a/plugins/Dbx_mdb/src/dbevents.cpp +++ b/plugins/Dbx_mdb/src/dbevents.cpp @@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
MDB_txn* txn_ptr_ro::m_txn;
+MDB_cursor* cursor_ptr_ro::m_cursor;
STDMETHODIMP_(LONG) CDbxMdb::GetEventCount(MCONTACT contactID)
{
@@ -246,7 +247,7 @@ STDMETHODIMP_(BOOL) CDbxMdb::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) void CDbxMdb::FindNextUnread(const txn_ptr &txn, DBCachedContact *cc, DBEventSortingKey &key2)
{
- cursor_ptr cursor(txn, m_dbEventsSort);
+ cursor_ptr_ro cursor(txn, m_dbEventsSort);
MDB_val key = { sizeof(key2), &key2 }, data;
key2.dwEventId++;
@@ -325,7 +326,7 @@ STDMETHODIMP_(MEVENT) CDbxMdb::FindFirstEvent(MCONTACT contactID) mir_cslock lck(m_csDbAccess);
txn_ptr_ro txn(m_pMdbEnv);
- cursor_ptr cursor(txn, m_dbEventsSort);
+ cursor_ptr_ro cursor(txn, m_dbEventsSort);
mdb_cursor_get(cursor, &key, &data, MDB_SET);
if (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) != MDB_SUCCESS)
return m_evLast = 0;
@@ -349,7 +350,7 @@ STDMETHODIMP_(MEVENT) CDbxMdb::FindLastEvent(MCONTACT contactID) mir_cslock lck(m_csDbAccess);
txn_ptr_ro txn(m_pMdbEnv);
- cursor_ptr cursor(txn, m_dbEventsSort);
+ cursor_ptr_ro cursor(txn, m_dbEventsSort);
mdb_cursor_get(cursor, &key, &data, MDB_SET);
if (mdb_cursor_get(cursor, &key, &data, MDB_PREV) != MDB_SUCCESS)
return m_evLast = 0;
@@ -380,7 +381,7 @@ STDMETHODIMP_(MEVENT) CDbxMdb::FindNextEvent(MCONTACT contactID, MEVENT hDbEvent DBEventSortingKey keyVal = { hDbEvent, ts, contactID };
MDB_val key = { sizeof(keyVal), &keyVal };
- cursor_ptr cursor(txn, m_dbEventsSort);
+ cursor_ptr_ro cursor(txn, m_dbEventsSort);
if (mdb_cursor_get(cursor, &key, &data, MDB_SET) != MDB_SUCCESS)
return m_evLast = 0;
@@ -413,7 +414,7 @@ STDMETHODIMP_(MEVENT) CDbxMdb::FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent DBEventSortingKey keyVal = { hDbEvent, ts, contactID };
MDB_val key = { sizeof(keyVal), &keyVal };
- cursor_ptr cursor(txn, m_dbEventsSort);
+ cursor_ptr_ro cursor(txn, m_dbEventsSort);
if (mdb_cursor_get(cursor, &key, &data, MDB_SET) != MDB_SUCCESS)
return m_evLast = 0;
|