core: hash_cstring: Prepare for M2-Planet.
* src/hash.c (hash_cstring): Prepare for M2-Planet.
This commit is contained in:
parent
5bae8803b2
commit
53e509ecf4
|
@ -27,8 +27,9 @@ int
|
|||
hash_cstring (char const *s, long size)
|
||||
{
|
||||
int hash = s[0] * 37;
|
||||
if (s[0] != 0 && s[1] != 0)
|
||||
hash = hash + s[1] * 43;
|
||||
if (s[0] != 0)
|
||||
if (s[1] != 0)
|
||||
hash = hash + s[1] * 43;
|
||||
assert_msg (size != 0, "size");
|
||||
hash = hash % size;
|
||||
return hash;
|
||||
|
|
Loading…
Reference in a new issue