aboutsummaryrefslogtreecommitdiff
path: root/src/hashfunctionstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/hashfunctionstring.cpp')
-rw-r--r--src/hashfunctionstring.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/hashfunctionstring.cpp b/src/hashfunctionstring.cpp
index 8ea9f57..6ce7bb3 100644
--- a/src/hashfunctionstring.cpp
+++ b/src/hashfunctionstring.cpp
@@ -10,12 +10,10 @@ HashFunctionString::~HashFunctionString()
10 10
11unsigned long int HashFunctionString::hash( const void *id ) 11unsigned long int HashFunctionString::hash( const void *id )
12{ 12{
13 const char *str = (const char *)id;
14 unsigned long int nPos = 0; 13 unsigned long int nPos = 0;
15 for( int j = 0; str[j] != '\0'; j++ ) 14 for( const char *s = (const char *)id; *s; s++ )
16 { 15 {
17 nPos = str[j] + (nPos << 6) + (nPos << 16) - nPos; 16 nPos = *s + (nPos << 6) + (nPos << 16) - nPos;
18// nPos += nPos<<16|(((unsigned long int)str[j])<<((j*7)%24));
19 } 17 }
20 return nPos; 18 return nPos;
21} 19}