diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-07-14 07:55:57 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-07-14 07:55:57 +0000 |
commit | 5b650d2d0c96545c5a276a1b819d0f5baebf8204 (patch) | |
tree | e3e4a43ea242d1d1f771c7ba251f47ac7f0db296 /src/hashfunctionstring.cpp | |
parent | f0f38e0f164b7e8b9132665407445d93f33be7ad (diff) | |
download | libbu++-5b650d2d0c96545c5a276a1b819d0f5baebf8204.tar.gz libbu++-5b650d2d0c96545c5a276a1b819d0f5baebf8204.tar.bz2 libbu++-5b650d2d0c96545c5a276a1b819d0f5baebf8204.tar.xz libbu++-5b650d2d0c96545c5a276a1b819d0f5baebf8204.zip |
Changed some stuff, not sure what all, minor stuff.
Diffstat (limited to 'src/hashfunctionstring.cpp')
-rw-r--r-- | src/hashfunctionstring.cpp | 6 |
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 | ||
11 | unsigned long int HashFunctionString::hash( const void *id ) | 11 | unsigned 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 | } |