diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-04-06 14:19:39 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-04-06 23:42:25 +0200 |
commit | dd03e8c281582af454fabfb4a666a5b232d518aa (patch) | |
tree | 2e6ee4ec36819f0c7e56abdf7c4b26a5d6a41c1d /lib/hash.c | |
parent | 67bd4ab19e2903b45b66278956801a681fc35520 (diff) | |
download | curl-dd03e8c281582af454fabfb4a666a5b232d518aa.tar.gz |
hash: calculate sizes with size_t instead of longs
... since they return size_t anyway!
closes #2462
Diffstat (limited to 'lib/hash.c')
-rw-r--r-- | lib/hash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/hash.c b/lib/hash.c index c99b1b699..15a128fec 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -261,11 +261,11 @@ size_t Curl_hash_str(void *key, size_t key_length, size_t slots_num) { const char *key_str = (const char *) key; const char *end = key_str + key_length; - unsigned long h = 5381; + size_t h = 5381; while(key_str < end) { h += h << 5; - h ^= (unsigned long) *key_str++; + h ^= *key_str++; } return (h % slots_num); |