# HG changeset patch # User Matti Hamalainen # Date 1337998576 -10800 # Node ID d55cc0b73c624c2f09a12160f9b71ce67ce352e9 # Parent aeb3171f9e28185c2385f069e5701628656eb425 Merge nn_user_free_list() into a parent function. diff -r aeb3171f9e28 -r d55cc0b73c62 util.c --- a/util.c Sat May 26 05:10:11 2012 +0300 +++ b/util.c Sat May 26 05:16:16 2012 +0300 @@ -442,19 +442,6 @@ } -static void nn_user_free_list(nn_user_t *list) -{ - nn_user_t *next, *curr = list; - - while (curr != NULL) - { - next = curr->next; - nn_user_free(curr); - curr = next; - } -} - - nn_user_t *nn_userhash_foreach(const nn_userhash_t *list, int (*func)(const nn_user_t *)) { int i; @@ -630,7 +617,15 @@ for (i = 0; i < NN_NUM_BUCKETS; i++) { - nn_user_free_list(hash->buckets[i]); + nn_user_t *curr = hash->buckets[i]; + + while (curr != NULL) + { + nn_user_t *next = curr->next; + nn_user_free(curr); + curr = next; + } + hash->buckets[i] = NULL; }