From db2b0599b97d4cd3b045079c0a370e9ebba51308 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Fri, 8 Nov 2019 14:20:59 +1000 Subject: Improve comments for JimResetHashTable() and Jim_FreeHashTable() Signed-off-by: Steve Bennett --- jim.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jim.c b/jim.c index ab67141..499fa69 100644 --- a/jim.c +++ b/jim.c @@ -727,7 +727,13 @@ unsigned int Jim_GenHashFunction(const unsigned char *buf, int len) /* ----------------------------- API implementation ------------------------- */ -/* reset a hashtable already initialized */ +/* + * Reset a hashtable already initialized. + * The table data should already have been freed. + * + * Note that type and privdata are not initialised + * to allow the now-empty hashtable to be reused + */ static void JimResetHashTable(Jim_HashTable *ht) { ht->table = NULL; @@ -899,7 +905,9 @@ int Jim_DeleteHashEntry(Jim_HashTable *ht, const void *key) return JIM_ERR; /* not found */ } -/* Destroy an entire hash table and leave it ready for reuse */ +/* Remove all entries from the hash table + * and leave it empty for reuse + */ int Jim_FreeHashTable(Jim_HashTable *ht) { unsigned int i; -- cgit v1.1