ucx/list.c

changeset 256
54433cb371df
parent 255
bf19378aed58
child 335
c1bc13faadaa
--- a/ucx/list.c	Fri Nov 18 15:27:45 2016 +0100
+++ b/ucx/list.c	Fri Nov 18 16:00:15 2016 +0100
@@ -159,40 +159,6 @@
     return nl;
 }
 
-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) {
-    
-    if (l) {
-        int found = 0;
-        UcxList *first;
-        {
-            UcxList *e = l;
-            while (e) {
-                found |= (cmpfnc(e->data, data, cmpdata) == 0);
-                first = e;
-                e = e->prev;
-            }
-        }
-
-        if (found) {
-            return first;
-        } else {
-            UcxList *nl = ucx_list_append_a(alloc, NULL, data);
-            nl->next = first;
-            first->prev = nl;
-            return nl;
-        }
-    } else {
-        return ucx_list_append_a(alloc, NULL, data);
-    }
-}
-
 UcxList *ucx_list_concat(UcxList *l1, UcxList *l2) {
     if (l1) {
         UcxList *last = ucx_list_last(l1);

mercurial