core: hash_cstring: Prepare for M2-Planet.

* src/hash.c (hash_cstring): Prepare for M2-Planet.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-07-16 21:19:06 +02:00
parent 5bae8803b2
commit 53e509ecf4
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273

View file

@ -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;