From e444d989b39b5a7cfc3c7a709505b9e865523158 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Thu, 24 Oct 2019 21:19:06 +0200 Subject: [PATCH] core: hash_cstring: Prepare for M2-Planet. * src/hash.c (hash_cstring): Prepare for M2-Planet. --- src/hash.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hash.c b/src/hash.c index 15066887..e648e872 100644 --- a/src/hash.c +++ b/src/hash.c @@ -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;