Remove unused function hash_ReplaceElement

This commit is contained in:
Rangi
2021-04-16 12:36:45 -04:00
parent 1ffd7cb5bb
commit d2f6def2eb
2 changed files with 0 additions and 22 deletions

View File

@@ -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

View File

@@ -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);