diff options
author | 2013-01-03 14:22:27 +0000 | |
---|---|---|
committer | 2013-01-03 14:22:27 +0000 | |
commit | cc0f95bb7409e4669fa81cf1d44b10560cb86cc4 (patch) | |
tree | ffdaa3b4561580b9af802f548104ba17288e0735 /src/lib/util/tagmap.h | |
parent | c014d27cd6d07e6911b04463dc7f6b6a71edbad2 (diff) |
tagmap: Try a slightly better hashing function [O. Galibert]
Diffstat (limited to 'src/lib/util/tagmap.h')
-rw-r--r-- | src/lib/util/tagmap.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/util/tagmap.h b/src/lib/util/tagmap.h index 63855b30e07..23fd72a5369 100644 --- a/src/lib/util/tagmap.h +++ b/src/lib/util/tagmap.h @@ -114,8 +114,8 @@ public: UINT32 hash(const char *string) const { UINT32 result = *string++; - for (char c = *string++; c != 0; c = *string++) - result = ((result << 5) | (result >> 27)) + c; + for (UINT8 c = *string++; c != 0; c = *string++) + result = (result*33) ^ c; return result; } |