From 5380ed0fad80744e3093a6fb6f13f8d8a7b2e03a Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 21 Feb 2016 09:42:11 +0000 Subject: dbx_lmdb: speed optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@16317 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/src/dbsettings.cpp | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'plugins/Dbx_mdb/src/dbsettings.cpp') diff --git a/plugins/Dbx_mdb/src/dbsettings.cpp b/plugins/Dbx_mdb/src/dbsettings.cpp index 99d99668e9..1d6caac3f9 100644 --- a/plugins/Dbx_mdb/src/dbsettings.cpp +++ b/plugins/Dbx_mdb/src/dbsettings.cpp @@ -61,18 +61,6 @@ int CDbxMdb::GetContactSettingWorker(MCONTACT contactID, LPCSTR szModule, LPCSTR // the db format can't tolerate more than 255 bytes of space (incl. null) for settings+module name int settingNameLen = (int)strlen(szSetting); int moduleNameLen = (int)strlen(szModule); - if (settingNameLen > 0xFE) { -#ifdef _DEBUG - OutputDebugStringA("GetContactSettingWorker() got a > 255 setting name length. \n"); -#endif - return 1; - } - if (moduleNameLen > 0xFE) { -#ifdef _DEBUG - OutputDebugStringA("GetContactSettingWorker() got a > 255 module name length. \n"); -#endif - return 1; - } mir_cslock lck(m_csDbAccess); @@ -524,18 +512,6 @@ STDMETHODIMP_(BOOL) CDbxMdb::DeleteContactSetting(MCONTACT contactID, LPCSTR szM // the db format can't tolerate more than 255 bytes of space (incl. null) for settings+module name int settingNameLen = (int)strlen(szSetting); int moduleNameLen = (int)strlen(szModule); - if (settingNameLen > 0xFE) { -#ifdef _DEBUG - OutputDebugStringA("DeleteContactSetting() got a > 255 setting name length. \n"); -#endif - return 1; - } - if (moduleNameLen > 0xFE) { -#ifdef _DEBUG - OutputDebugStringA("DeleteContactSetting() got a > 255 module name length. \n"); -#endif - return 1; - } MCONTACT saveContact = contactID; { @@ -577,7 +553,6 @@ STDMETHODIMP_(BOOL) CDbxMdb::EnumContactSettings(MCONTACT contactID, DBCONTACTEN return -1; int result = 0; - mir_cslock lck(m_csDbAccess); DBSettingKey keySearch; keySearch.dwContactID = contactID; @@ -586,8 +561,9 @@ STDMETHODIMP_(BOOL) CDbxMdb::EnumContactSettings(MCONTACT contactID, DBCONTACTEN LIST arSettings(50); { + mir_cslock lck(m_csDbAccess); txn_ptr_ro trnlck(m_txn); - cursor_ptr cursor(trnlck, m_dbSettings); + cursor_ptr_ro cursor(m_curSettings); MDB_val key = { sizeof(keySearch), &keySearch }, data; if (mdb_cursor_get(cursor, &key, &data, MDB_SET_RANGE) == MDB_SUCCESS) { -- cgit v1.2.3