aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/hash.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/hash.c b/lib/hash.c
index 76a7d2bb6..af2887758 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -306,16 +306,11 @@ size_t Curl_hash_str(void* key, size_t key_length, size_t slots_num)
return (h % slots_num);
}
-size_t Curl_str_key_compare(void*k1, size_t key1_len, void*k2, size_t key2_len)
+size_t Curl_str_key_compare(void *k1, size_t key1_len,
+ void *k2, size_t key2_len)
{
- char *key1 = (char *)k1;
- char *key2 = (char *)k2;
-
- if(key1_len == key2_len &&
- *key1 == *key2 &&
- memcmp(key1, key2, key1_len) == 0) {
+ if((key1_len == key2_len) && !memcmp(k1, k2, key1_len))
return 1;
- }
return 0;
}