From ed204fe350540966e492859c9f9c734b6b9f1cde Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 3 Jul 2016 17:19:54 +0000 Subject: dbx_lmdb: code optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@17057 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/src/dbintf.h | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'plugins/Dbx_mdb/src/dbintf.h') diff --git a/plugins/Dbx_mdb/src/dbintf.h b/plugins/Dbx_mdb/src/dbintf.h index 5aeadf3488..51ee91ed64 100644 --- a/plugins/Dbx_mdb/src/dbintf.h +++ b/plugins/Dbx_mdb/src/dbintf.h @@ -35,15 +35,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MARKED_READ (DBEF_READ | DBEF_SENT) -struct ModuleName -{ - DWORD dwId; - char szName[]; -}; - #include -#define DBHEADER_VERSION MAKELONG(1, 2) +#define DBHEADER_VERSION MAKELONG(1, 3) #define DBHEADER_SIGNATURE 0x40DECADEu struct DBHeader @@ -124,8 +118,6 @@ struct EventItem DWORD eventId; }; -class LMDBEventCursor; - struct CDbxMdb : public MIDatabase, public MIDatabaseChecker, public MZeroedObject { friend class LMDBEventCursor; @@ -216,7 +208,7 @@ public: protected: MDB_env *m_pMdbEnv; - MDB_txn *m_txn; + TXN_RO m_txn; DWORD m_dwFileSize; MDB_dbi m_dbGlobal; DBHeader m_header; @@ -261,19 +253,17 @@ protected: MDB_dbi m_dbModules; MDB_cursor *m_curModules; + + std::map m_Modules; - HANDLE m_hModHeap; - LIST m_lMods, m_lOfs; LIST m_lResidentSettings; HANDLE hEventAddedEvent, hEventDeletedEvent, hEventFilterAddedEvent; MCONTACT m_hLastCachedContact; - DWORD m_maxModuleID; - void AddToList(const char *name, DWORD ofs); - DWORD FindExistingModuleNameOfs(const char *szName); - int InitModuleNames(void); - DWORD GetModuleNameOfs(const char *szName); - char* GetModuleNameByOfs(DWORD ofs); + int InitModules(); + + DWORD GetModuleID(const char *szName); + char* GetModuleName(DWORD dwId); int GetContactSettingWorker(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv, int isStatic); -- cgit v1.2.3