mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Remove unused function hash_ReplaceElement
This commit is contained in:
@@ -33,16 +33,6 @@ typedef struct HashMapEntry *HashMap[HASHMAP_NB_BUCKETS];
|
|||||||
*/
|
*/
|
||||||
void **hash_AddElement(HashMap map, char const *key, void *element);
|
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.
|
* Removes an element from a hashmap.
|
||||||
* @param map The HashMap to remove the element from
|
* @param map The HashMap to remove the element from
|
||||||
|
|||||||
@@ -64,18 +64,6 @@ void **hash_AddElement(HashMap map, char const *key, void *element)
|
|||||||
return &newEntry->content;
|
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)
|
bool hash_RemoveElement(HashMap map, char const *key)
|
||||||
{
|
{
|
||||||
HashType hashedKey = hash(key);
|
HashType hashedKey = hash(key);
|
||||||
|
|||||||
Reference in New Issue
Block a user