mirror of
https://github.com/holub/mame
synced 2025-06-09 22:33:00 +03:00
tagmap: Try a slightly better hashing function [O. Galibert]
This commit is contained in:
parent
c014d27cd6
commit
cc0f95bb74
@ -114,8 +114,8 @@ public:
|
|||||||
UINT32 hash(const char *string) const
|
UINT32 hash(const char *string) const
|
||||||
{
|
{
|
||||||
UINT32 result = *string++;
|
UINT32 result = *string++;
|
||||||
for (char c = *string++; c != 0; c = *string++)
|
for (UINT8 c = *string++; c != 0; c = *string++)
|
||||||
result = ((result << 5) | (result >> 27)) + c;
|
result = (result*33) ^ c;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user