hashtable entrycount

This commit is contained in:
Matheus
2022-08-02 21:44:27 -03:00
parent 3653e01505
commit 8d90e27f15
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -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
+3 -2
View File
@@ -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;