summaryrefslogtreecommitdiff
path: root/plugins/Variables/src/tokenregister.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-08-13 11:51:22 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-08-13 11:51:29 +0300
commitef7127e9715147094e39e27edb0143aaecff695b (patch)
tree095ac791d232df9f682c7432e59b304fbc4d8ead /plugins/Variables/src/tokenregister.cpp
parentaf5b577d924b941d85d87280b1b4df37b848e510 (diff)
Variables:
- plugin's own hash implementation replaced with the core function; - unused header dbhelpers.h removed; - code cleaning
Diffstat (limited to 'plugins/Variables/src/tokenregister.cpp')
-rw-r--r--plugins/Variables/src/tokenregister.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/plugins/Variables/src/tokenregister.cpp b/plugins/Variables/src/tokenregister.cpp
index 12838ec7fa..236389a4b6 100644
--- a/plugins/Variables/src/tokenregister.cpp
+++ b/plugins/Variables/src/tokenregister.cpp
@@ -37,17 +37,10 @@ static LIST<TokenRegisterEntry> tokens(100, CompareTokens);
static mir_cs csRegister;
-unsigned long int hashlittle(void *key, size_t length, unsigned long int initval);
-
-static DWORD NameHashFunction(wchar_t *tszStr)
-{
- return (DWORD)hashlittle(tszStr, mir_wstrlen(tszStr)*sizeof(wchar_t), 0);
-}
-
static TokenRegisterEntry* FindTokenRegisterByName(wchar_t *name)
{
TokenRegisterEntry temp;
- temp.nameHash = NameHashFunction(name);
+ temp.nameHash = mir_hashstrW(name);
return tokens.find(&temp);
}
@@ -106,12 +99,12 @@ INT_PTR registerToken(WPARAM, LPARAM lParam)
if (newVr->flags & TRF_TCHAR) {
deRegisterToken(newVr->szTokenString.w);
- hash = NameHashFunction(newVr->szTokenString.w);
+ hash = mir_hashstrW(newVr->szTokenString.w);
}
else {
wchar_t *wtoken = mir_a2u(newVr->szTokenString.a);
deRegisterToken(wtoken);
- hash = NameHashFunction(wtoken);
+ hash = mir_hashstrW(wtoken);
mir_free(wtoken);
}