mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
hashtable entrycount
This commit is contained in:
@@ -12,6 +12,7 @@ typedef struct{
|
||||
|
||||
typedef struct{
|
||||
size_t size;
|
||||
size_t entrycount;
|
||||
hashtableentry* entries;
|
||||
} hashtable;
|
||||
|
||||
@@ -20,6 +21,6 @@ bool hashtable_insert(hashtable*, char*, void*);
|
||||
bool hashtable_remove(hashtable*, char*);
|
||||
void hashtable_destroy(hashtable*);
|
||||
void* hashtable_get(hashtable*, char*);
|
||||
bool* hashtable_set(hashtable*, char*, void*);
|
||||
bool hashtable_set(hashtable*, char*, void*);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -52,7 +52,8 @@ bool hashtable_insert(hashtable* table, char* key, void* val){
|
||||
|
||||
entry->key = keysave;
|
||||
entry->val = val;
|
||||
|
||||
++table->entrycount;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
@@ -88,9 +89,9 @@ bool hashtable_remove(hashtable* table, char* key){
|
||||
else{
|
||||
memset(entry, 0, sizeof(hashtableentry));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
--table->entrycount;
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user