ucx/list.c

changeset 229
9db71925eaa8
parent 228
9f385abc72fb
child 250
b7d1317b138e
     1.1 --- a/ucx/list.c	Fri Nov 18 15:17:04 2016 +0100
     1.2 +++ b/ucx/list.c	Fri Nov 18 15:33:58 2016 +0100
     1.3 @@ -159,40 +159,6 @@
     1.4      return nl;
     1.5  }
     1.6  
     1.7 -UcxList *ucx_list_prepend_once(UcxList *l, void *data,
     1.8 -        cmp_func cmpfnc, void* cmpdata) {
     1.9 -    return ucx_list_prepend_once_a(ucx_default_allocator(), l,
    1.10 -            data, cmpfnc, cmpdata);
    1.11 -}
    1.12 -
    1.13 -UcxList *ucx_list_prepend_once_a(UcxAllocator *alloc, UcxList *l, void *data,
    1.14 -        cmp_func cmpfnc, void *cmpdata) {
    1.15 -    
    1.16 -    if (l) {
    1.17 -        int found = 0;
    1.18 -        UcxList *first;
    1.19 -        {
    1.20 -            UcxList *e = l;
    1.21 -            while (e) {
    1.22 -                found |= (cmpfnc(e->data, data, cmpdata) == 0);
    1.23 -                first = e;
    1.24 -                e = e->prev;
    1.25 -            }
    1.26 -        }
    1.27 -
    1.28 -        if (found) {
    1.29 -            return first;
    1.30 -        } else {
    1.31 -            UcxList *nl = ucx_list_append_a(alloc, NULL, data);
    1.32 -            nl->next = first;
    1.33 -            first->prev = nl;
    1.34 -            return nl;
    1.35 -        }
    1.36 -    } else {
    1.37 -        return ucx_list_append_a(alloc, NULL, data);
    1.38 -    }
    1.39 -}
    1.40 -
    1.41  UcxList *ucx_list_concat(UcxList *l1, UcxList *l2) {
    1.42      if (l1) {
    1.43          UcxList *last = ucx_list_last(l1);

mercurial