add init function
This commit is contained in:
parent
ee37ac4da9
commit
d5e58616a2
@ -23,6 +23,10 @@ entry_hash_t key_hash(entry_key_t key) {
|
|||||||
return strhash_str(key) + 1; // make hash always nonzero
|
return strhash_str(key) + 1; // make hash always nonzero
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void hashtable_init(struct hashtable * table) {
|
||||||
|
memset(table, 0, sizeof(table));
|
||||||
|
}
|
||||||
|
|
||||||
hashtable_iterator_t hashtable_end(struct hashtable * table) {
|
hashtable_iterator_t hashtable_end(struct hashtable * table) {
|
||||||
return table->data + table->len;
|
return table->data + table->len;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user