Skip to content

Commit 330da1a

Browse files
committed
Rename internal hash funcs to match the current algorithms
1 parent 334173f commit 330da1a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib/hash.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ static_assert((MIN_BUCKETS & (MIN_BUCKETS - 1)) == 0,
8181
"Bucket size is power of 2");
8282

8383
static inline unsigned int hash_fnv1a_32(const void *keyptr);
84-
static inline unsigned int hash_int_shift_mult(const void *keyptr);
85-
static inline unsigned int hash_int64_shift_mult(const void *keyptr);
84+
static inline unsigned int hash_int_32(const void *keyptr);
85+
static inline unsigned int hash_int_64(const void *keyptr);
8686

8787
static unsigned int odd_constant = DEFAULT_ODD_CONSTANT;
8888
static unsigned (*hash_str)(const void *key) = hash_fnv1a_32;
89-
static unsigned (*hash_int)(const void *key) = hash_int_shift_mult;
90-
static unsigned (*hash_int64)(const void *key) = hash_int64_shift_mult;
89+
static unsigned (*hash_int)(const void *key) = hash_int_32;
90+
static unsigned (*hash_int64)(const void *key) = hash_int_64;
9191

9292
static bool resize_bucket(struct hash_bucket *bucket, unsigned int new_size)
9393
{
@@ -120,13 +120,13 @@ static inline unsigned int hash_fnv1a_32(const void *keyptr)
120120
return fnv1a_32(keyptr, strlen(keyptr));
121121
}
122122

123-
static inline unsigned int hash_int_shift_mult(const void *keyptr)
123+
static inline unsigned int hash_int_32(const void *keyptr)
124124
{
125125
unsigned int key = (unsigned int)(long)keyptr;
126126
return fnv1a_32(&key, sizeof(key));
127127
}
128128

129-
static inline unsigned int hash_int64_shift_mult(const void *keyptr)
129+
static inline unsigned int hash_int_64(const void *keyptr)
130130
{
131131
const uint64_t key = (uint64_t)(uintptr_t)keyptr;
132132
return fnv1a_32(&key, sizeof(key));

0 commit comments

Comments
 (0)