summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-04-05 22:57:45 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-04-05 22:57:45 +0000
commit0cd6f180701a35abe5da0f4b0272b3047c03e330 (patch)
treeb125489be5670eb775dd43f96236744eaedf9ef3 /plugins/Dbx_mdb/src
parent56e1f721234e3f6d1ef3eb8cff2dc3f322c2b831 (diff)
various speed optimizations
git-svn-id: http://svn.miranda-ng.org/main/trunk@12621 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src')
-rw-r--r--plugins/Dbx_mdb/src/dbintf.h1
-rw-r--r--plugins/Dbx_mdb/src/dbmodulechain.cpp9
2 files changed, 8 insertions, 2 deletions
diff --git a/plugins/Dbx_mdb/src/dbintf.h b/plugins/Dbx_mdb/src/dbintf.h
index d4b8a587a5..4183e6cd18 100644
--- a/plugins/Dbx_mdb/src/dbintf.h
+++ b/plugins/Dbx_mdb/src/dbintf.h
@@ -269,6 +269,7 @@ protected:
HANDLE hEventAddedEvent, hEventDeletedEvent, hEventFilterAddedEvent;
MCONTACT m_hLastCachedContact;
int m_maxModuleID;
+ ModuleName *m_lastmn;
void AddToList(char *name, DWORD ofs);
DWORD FindExistingModuleNameOfs(const char *szName);
diff --git a/plugins/Dbx_mdb/src/dbmodulechain.cpp b/plugins/Dbx_mdb/src/dbmodulechain.cpp
index 9342ea3cb1..fc33b8de8b 100644
--- a/plugins/Dbx_mdb/src/dbmodulechain.cpp
+++ b/plugins/Dbx_mdb/src/dbmodulechain.cpp
@@ -71,10 +71,15 @@ int CDbxMdb::InitModuleNames(void)
DWORD CDbxMdb::FindExistingModuleNameOfs(const char *szName)
{
ModuleName mn = { (char*)szName, 0 };
+ if (m_lastmn && !strcmp(mn.name, m_lastmn->name))
+ return m_lastmn->ofs;
int index = m_lMods.getIndex(&mn);
- if (index != -1)
- return m_lMods[index]->ofs;
+ if (index != -1) {
+ ModuleName *pmn = m_lMods[index];
+ m_lastmn = pmn;
+ return pmn->ofs;
+ }
return 0;
}