add h_hashtable_update and h_hashset_put_all
This commit is contained in:
parent
109d60fca3
commit
209bd43f10
2 changed files with 12 additions and 0 deletions
|
|
@ -166,6 +166,16 @@ void h_hashtable_put(HHashTable* ht, const void* key, void* value) {
|
|||
hte->hashval = hashval;
|
||||
}
|
||||
|
||||
void h_hashtable_update(HHashTable *dst, const HHashTable *src) {
|
||||
size_t i;
|
||||
HHashTableEntry *hte;
|
||||
for(i=0; i < src->capacity; i++) {
|
||||
for(hte = &src->contents[i]; hte; hte = hte->next) {
|
||||
h_hashtable_put(dst, hte->key, hte->value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int h_hashtable_present(HHashTable* ht, const void* key) {
|
||||
HHashValue hashval = ht->hashFunc(key);
|
||||
#ifdef CONSISTENCY_CHECK
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue