From fcfd43b2b477eab776d3801d3b04a6df3025e970 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) 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 3e8c3d39..9b9dddd7 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;