From 0085b0df8d16bc764cb61e0a6fce1eaa4dbd9ed2 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Tue, 28 Mar 2017 23:57:27 +0200 Subject: [PATCH] Use of m_core_hash for m_string_hash (avoid duplication of code). --- m-string.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/m-string.h b/m-string.h index 3b37bc36..58c6a87b 100644 --- a/m-string.h +++ b/m-string.h @@ -571,14 +571,7 @@ static inline size_t string_hash(const string_t v) { STRING_CONTRACT (v); - const char *p = string_get_cstr(v); - M_HASH_DECL(hash); - char c; - do { - c = *p++; - M_HASH_UP(hash, M_ASSIGN_CAST(unsigned int,c)); - } while (c != 0); - return hash; + return m_core_hash(v->ptr, v->size); } static inline void