diff --git a/include/hashmap.h b/include/hashmap.h index c6e6ba17..d751e360 100644 --- a/include/hashmap.h +++ b/include/hashmap.h @@ -33,16 +33,6 @@ typedef struct HashMapEntry *HashMap[HASHMAP_NB_BUCKETS]; */ void **hash_AddElement(HashMap map, char const *key, void *element); -/** - * Replaces an element with an already-present key in a hashmap. - * @warning Inserting a NULL will make `hash_GetElement`'s return ambiguous! - * @param map The HashMap to replace the element in - * @param key The key with which the element will be stored and retrieved - * @param element The element to replace - * @return True if the element was found and replaced - */ -bool hash_ReplaceElement(HashMap const map, char const *key, void *element); - /** * Removes an element from a hashmap. * @param map The HashMap to remove the element from diff --git a/src/hashmap.c b/src/hashmap.c index a038c4e0..dd8b791b 100644 --- a/src/hashmap.c +++ b/src/hashmap.c @@ -64,18 +64,6 @@ void **hash_AddElement(HashMap map, char const *key, void *element) return &newEntry->content; } -bool hash_ReplaceElement(HashMap const map, char const *key, void *element) -{ - void **node = hash_GetNode(map, key); - - if (node) { - *node = element; - return true; - } else { - return false; - } -} - bool hash_RemoveElement(HashMap map, char const *key) { HashType hashedKey = hash(key);