# HG changeset patch # User Matti Hamalainen # Date 1583760049 -7200 # Node ID 9c61834c191b2615cefb62538ac909e8947b0e3a # Parent a54298eef91a380c099ce33f99d643624493df30 Remove th_llist_delete() and th_llist_delete_node() and rename th_llist_delete_node_fast() to th_llist_delete_node(). diff -r a54298eef91a -r 9c61834c191b th_datastruct.c --- a/th_datastruct.c Fri Mar 06 20:55:43 2020 +0200 +++ b/th_datastruct.c Mon Mar 09 15:20:49 2020 +0200 @@ -155,7 +155,7 @@ */ -void th_llist_delete_node_fast(th_llist_t **list, th_llist_t *node) +void th_llist_delete_node(th_llist_t **list, th_llist_t *node) { if (node == *list) { @@ -186,42 +186,6 @@ } -void th_llist_delete_node(th_llist_t **list, th_llist_t *node) -{ - th_llist_t *curr = *list; - - while (curr != NULL) - { - th_llist_t *next = curr->next; - if (curr == node) - { - th_llist_delete_node_fast(list, curr); - th_free(node); - break; - } - curr = next; - } -} - - -void th_llist_delete(th_llist_t **list, const void *data) -{ - th_llist_t *curr = *list; - - while (curr != NULL) - { - th_llist_t *next = curr->next; - if (curr->data == data) - { - th_llist_delete_node_fast(list, curr); - th_free(curr); - break; - } - curr = next; - } -} - - th_llist_t * th_llist_get_nth(th_llist_t *list, const size_t n) { th_llist_t *curr = list; diff -r a54298eef91a -r 9c61834c191b th_datastruct.h --- a/th_datastruct.h Fri Mar 06 20:55:43 2020 +0200 +++ b/th_datastruct.h Mon Mar 09 15:20:49 2020 +0200 @@ -37,9 +37,7 @@ th_llist_t * th_llist_append(th_llist_t **list, void *data); void th_llist_prepend_node(th_llist_t **list, th_llist_t *node); th_llist_t * th_llist_prepend(th_llist_t **list, void *data); -void th_llist_delete(th_llist_t **list, const void *data); void th_llist_delete_node(th_llist_t **list, th_llist_t *node); -void th_llist_delete_node_fast(th_llist_t **list, th_llist_t *node); th_llist_t * th_llist_get_nth(th_llist_t *list, const size_t n); size_t th_llist_length(const th_llist_t *list); diff -r a54298eef91a -r 9c61834c191b th_network.c --- a/th_network.c Fri Mar 06 20:55:43 2020 +0200 +++ b/th_network.c Mon Mar 09 15:20:49 2020 +0200 @@ -711,7 +711,7 @@ { // Remove from linked list if (conn->node != NULL) - th_llist_delete_node_fast(&th_conn_list, conn->node); + th_llist_delete_node(&th_conn_list, conn->node); // Free connection data th_conn_free_nodelete(conn);