From b745b2eb3fdefac77be5fdf5ea6747f21dc119b8 Mon Sep 17 00:00:00 2001 From: Marrub Date: Fri, 21 Oct 2016 14:43:59 -0400 Subject: [PATCH] Hashmap: Change Lth_HashFindItr's parameters --- lithos_c/inc/Lth_hashmap.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lithos_c/inc/Lth_hashmap.h b/lithos_c/inc/Lth_hashmap.h index a3d6c58..500b89e 100644 --- a/lithos_c/inc/Lth_hashmap.h +++ b/lithos_c/inc/Lth_hashmap.h @@ -108,13 +108,10 @@ static inline void Lth_HashMapBuild(Lth_HashMap *map) // // Lth_HashMapFindItr // -static inline Lth_HashMapElem *Lth_HashFindItr(Lth_HashMap *map, - char const *key) +static inline Lth_HashMapElem *Lth_HashFindItr(Lth_HashMap *map, size_t hash) { if(map->table == NULL) return NULL; - size_t hash = Lth_Hash_char(key); - for(Lth_HashMapElem *elem = map->table[hash % map->elem.size]; elem; elem = elem->next) { @@ -130,7 +127,7 @@ static inline Lth_HashMapElem *Lth_HashFindItr(Lth_HashMap *map, // static inline void *Lth_HashMapFind(Lth_HashMap *map, char const *key) { - Lth_HashMapElem *elem = Lth_HashFindItr(map, key); + Lth_HashMapElem *elem = Lth_HashFindItr(map, Lth_Hash_char(key)); if(elem == NULL) return NULL; return elem->value; }