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