Use of m_core_hash instead of hand written function.

This commit is contained in:
Patrick Pelissier committed 2017-03-29 00:00:52 +02:00
1 parent 0085b0df8d
commit bf27af5388
1 file changed
+1 -4
+1 -4
View File
@@ -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))