diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-21 09:42:11 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-21 09:42:11 +0000 |
commit | 5380ed0fad80744e3093a6fb6f13f8d8a7b2e03a (patch) | |
tree | af15eeb3b7f96efca86f4d05afc9df694962e020 /plugins/Dbx_mdb/src/dbmodulechain.cpp | |
parent | e151d6242dafb449fae9784e19e8122c44b57095 (diff) |
dbx_lmdb: speed optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@16317 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbmodulechain.cpp')
-rw-r--r-- | plugins/Dbx_mdb/src/dbmodulechain.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/plugins/Dbx_mdb/src/dbmodulechain.cpp b/plugins/Dbx_mdb/src/dbmodulechain.cpp index cc988e3f66..77ad7c8481 100644 --- a/plugins/Dbx_mdb/src/dbmodulechain.cpp +++ b/plugins/Dbx_mdb/src/dbmodulechain.cpp @@ -42,15 +42,13 @@ int CDbxMdb::InitModuleNames(void) {
m_maxModuleID = 0;
+ mir_cslock lck(m_csDbAccess);
txn_ptr_ro trnlck(m_txn);
- //mdb_open(trnlck, "modules", MDB_INTEGERKEY, &m_dbModules);
-
- cursor_ptr cursor(trnlck, m_dbModules);
- if (!cursor)
- return 1;
+ cursor_ptr_ro cursor(m_curModules);
MDB_val key, data;
- while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == 0) {
+ while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == 0)
+ {
DBModuleName *pmod = (DBModuleName*)data.mv_data;
if (pmod->dwSignature != DBMODULENAME_SIGNATURE)
DatabaseCorruption(NULL);
|