Previous 199869 Revisions Next

r20039 Thursday 3rd January, 2013 at 14:22:27 UTC by O. Galibert
tagmap: Try a slightly better hashing function [O. Galibert]
[src/lib/util]tagmap.h

trunk/src/lib/util/tagmap.h
r20038r20039
114114   UINT32 hash(const char *string) const
115115   {
116116      UINT32 result = *string++;
117      for (char c = *string++; c != 0; c = *string++)
118         result = ((result << 5) | (result >> 27)) + c;
117      for (UINT8 c = *string++; c != 0; c = *string++)
118         result = (result*33) ^ c;
119119      return result;
120120   }
121121

Previous 199869 Revisions Next


© 1997-2024 The MAME Team