mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
hashtable_destroy()
This commit is contained in:
@@ -18,6 +18,7 @@ typedef struct{
|
||||
bool hashtable_init(hashtable*, size_t);
|
||||
bool hashtable_insert(hashtable*, char*, void*);
|
||||
bool hashtable_remove(hashtable*, char*);
|
||||
void hashtable_destroy(hashtable*);
|
||||
void* hashtable_get(hashtable*, char*);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -112,3 +112,12 @@ void* hashtable_get(hashtable* table, char* key){
|
||||
|
||||
return entry->val;
|
||||
}
|
||||
|
||||
void hashtable_destroy(hashtable* table){
|
||||
|
||||
// would be cool if this also deleted non removed entries
|
||||
|
||||
free(table->entries);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user