Skip to content

Commit

Permalink
add xh_clear
Browse files Browse the repository at this point in the history
  • Loading branch information
nyuichi committed Feb 12, 2014
1 parent 44c9f36 commit f8599bd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion xhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ xh_put_int(xhash *x, long key, long val)
}

static inline void
xh_destroy(xhash *x)
xh_clear(xhash *x)
{
size_t i;
xh_entry *e, *d;
Expand All @@ -154,7 +154,15 @@ xh_destroy(xhash *x)
free(e);
e = d;
}
x->buckets[i] = NULL;
}
}

static inline void
xh_destroy(xhash *x)
{
xh_clear(x);
free(x->buckets);
free(x);
}

Expand Down

0 comments on commit f8599bd

Please sign in to comment.