@@ -81,13 +81,13 @@ static_assert((MIN_BUCKETS & (MIN_BUCKETS - 1)) == 0,
81
81
"Bucket size is power of 2" );
82
82
83
83
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 );
86
86
87
87
static unsigned int odd_constant = DEFAULT_ODD_CONSTANT ;
88
88
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 ;
91
91
92
92
static bool resize_bucket (struct hash_bucket * bucket , unsigned int new_size )
93
93
{
@@ -120,13 +120,13 @@ static inline unsigned int hash_fnv1a_32(const void *keyptr)
120
120
return fnv1a_32 (keyptr , strlen (keyptr ));
121
121
}
122
122
123
- static inline unsigned int hash_int_shift_mult (const void * keyptr )
123
+ static inline unsigned int hash_int_32 (const void * keyptr )
124
124
{
125
125
unsigned int key = (unsigned int )(long )keyptr ;
126
126
return fnv1a_32 (& key , sizeof (key ));
127
127
}
128
128
129
- static inline unsigned int hash_int64_shift_mult (const void * keyptr )
129
+ static inline unsigned int hash_int_64 (const void * keyptr )
130
130
{
131
131
const uint64_t key = (uint64_t )(uintptr_t )keyptr ;
132
132
return fnv1a_32 (& key , sizeof (key ));
0 commit comments