Mercurial > hg > th-libs
diff th_datastruct.c @ 689:9c61834c191b
Remove th_llist_delete() and th_llist_delete_node() and rename
th_llist_delete_node_fast() to th_llist_delete_node().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 09 Mar 2020 15:20:49 +0200 |
parents | b383f4e6ab89 |
children | 4ca6a3b30fe8 |
line wrap: on
line diff
--- 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;