55
66#include "alloc.h"
77#include "hashmap.h"
8+ #include "private.h"
89
9- static int hashmap_ensure_size (hashmap * hm );
10- static int hashmap_resize (hashmap * hm );
11- static uint32_t _hashmap_find_empty_index (hashmap * hm , uint32_t hash );
10+ private int hashmap_ensure_size (hashmap * hm );
11+ private int hashmap_resize (hashmap * hm );
12+ private uint32_t _hashmap_find_empty_index (hashmap * hm , uint32_t hash );
13+ private int32_t _hashmap_find_index (hashmap * hm , char * key , uint32_t hash );
1214
1315/**
1416 * Allocate and initialize a new hashmap with default capacity
@@ -167,7 +169,7 @@ int hashmap_set(hashmap *hm, char *key, int value)
167169 *
168170 * Return: 0 on success, error code on failure
169171 */
170- static int hashmap_ensure_size (hashmap * hm )
172+ private int hashmap_ensure_size (hashmap * hm )
171173{
172174 int result ;
173175 if (hm -> count >= USABLE_FRACTION (hm -> length )) {
@@ -188,7 +190,7 @@ static int hashmap_ensure_size(hashmap *hm)
188190 *
189191 * Return: 0 on success, error code on failure
190192 */
191- static int hashmap_resize (hashmap * hm )
193+ private int hashmap_resize (hashmap * hm )
192194{
193195 hashmap_item * item ;
194196 hashmap_item * * old_items = hm -> items ;
@@ -299,7 +301,7 @@ hashmap_item *hashmap_get(hashmap *hm, char *key)
299301 *
300302 * Return: Non-negative index if found, -E_HASHMAP_KEY_NOT_FOUND if not found
301303 */
302- int32_t _hashmap_find_index (hashmap * hm , char * key , uint32_t hash )
304+ private int32_t _hashmap_find_index (hashmap * hm , char * key , uint32_t hash )
303305{
304306 uint32_t mask = hm -> length - 1 ;
305307 uint32_t i = hash & mask ;
@@ -336,7 +338,7 @@ int32_t _hashmap_find_index(hashmap *hm, char *key, uint32_t hash)
336338 *
337339 * Return: Index of empty/deleted slot, or -E_HASHMAP_KEY_NOT_FOUND if table is full
338340 */
339- static uint32_t _hashmap_find_empty_index (hashmap * hm , uint32_t hash )
341+ private uint32_t _hashmap_find_empty_index (hashmap * hm , uint32_t hash )
340342{
341343 uint32_t mask = hm -> length - 1 ;
342344 uint32_t i = hash & mask ;
0 commit comments