diff -r fd21d1840dff -r b8c49e7a1dba src/list.c --- a/src/list.c Wed May 16 19:33:31 2018 +0200 +++ b/src/list.c Thu May 17 11:13:02 2018 +0200 @@ -107,74 +107,6 @@ } } -UcxList *ucx_list_append_once(UcxList *l, void *data, - cmp_func cmpfnc, void *cmpdata) { - return ucx_list_append_once_a(ucx_default_allocator(), l, - data, cmpfnc, cmpdata); -} - -UcxList *ucx_list_append_once_a(UcxAllocator *alloc, UcxList *l, void *data, - cmp_func cmpfnc, void *cmpdata) { - - UcxList *last = NULL; - { - UcxList *e = l; - while (e) { - if (cmpfnc(e->data, data, cmpdata) == 0) { - return l; - } - last = e; - e = e->next; - } - } - - UcxList *nl = ucx_list_append_a(alloc, NULL, data); - if (!nl) { - return NULL; - } - - if (last == NULL) { - return nl; - } else { - nl->prev = last; - last->next = nl; - return l; - } -} - -UcxList *ucx_list_prepend_once(UcxList *l, void *data, - cmp_func cmpfnc, void *cmpdata) { - return ucx_list_prepend_once_a(ucx_default_allocator(), l, - data, cmpfnc, cmpdata); -} - -UcxList *ucx_list_prepend_once_a(UcxAllocator *alloc, UcxList *l, void *data, - cmp_func cmpfnc, void *cmpdata) { - - UcxList* first = ucx_list_first(l); - { - UcxList *e = first; - while (e) { - if (cmpfnc(e->data, data, cmpdata) == 0) { - return l; - } - e = e->next; - } - } - - UcxList *nl = ucx_list_append_a(alloc, NULL, data); - if (!nl) { - return NULL; - } - - if (first) { - nl->next = first; - first->prev = nl; - } - - return nl; -} - UcxList *ucx_list_prepend(UcxList *l, void *data) { return ucx_list_prepend_a(ucx_default_allocator(), l, data); }