linkhash.c: optimised the table_free path
This commit is contained in:
@@ -562,10 +562,9 @@ int lh_table_resize(struct lh_table *t, int new_size)
|
|||||||
void lh_table_free(struct lh_table *t)
|
void lh_table_free(struct lh_table *t)
|
||||||
{
|
{
|
||||||
struct lh_entry *c;
|
struct lh_entry *c;
|
||||||
for(c = t->head; c != NULL; c = c->next) {
|
if(t->free_fn) {
|
||||||
if(t->free_fn) {
|
for(c = t->head; c != NULL; c = c->next)
|
||||||
t->free_fn(c);
|
t->free_fn(c);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
free(t->table);
|
free(t->table);
|
||||||
free(t);
|
free(t);
|
||||||
|
|||||||
Reference in New Issue
Block a user