From bf27af5388fcc6377242adf6e236a35b8cd64d95 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Wed, 29 Mar 2017 00:00:52 +0200 Subject: [PATCH] Use of m_core_hash instead of hand written function. --- bench/bench-mlib.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bench/bench-mlib.c b/bench/bench-mlib.c index cac33807..e3f54619 100644 --- a/bench/bench-mlib.c +++ b/bench/bench-mlib.c @@ -139,10 +139,7 @@ static void char_init (char_array_t a) { a[0] = 0; } static void char_set (char_array_t a, const char_array_t b) { strcpy(a, b); } static bool char_equal_p (const char_array_t a, const char_array_t b) { return strcmp(a,b)==0; } static size_t char_hash(const char_array_t a) { - M_HASH_DECL(hash); - const char *s = a; - while (*s) M_HASH_UP(hash, *s++); - return hash; + return m_core_hash (a, strlen(a)); } // NOTE: Can't set OPLIST as a macro! #define CHAR_OPLIST (INIT(char_init), INIT_SET(char_set), SET(char_set), CLEAR(char_init), HASH(char_hash), EQUAL(char_equal_p))