change cxLinkedListCreate() setting all fields instead of calling cxListRecalculateSize()

Tue, 28 Sep 2021 18:09:14 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 28 Sep 2021 18:09:14 +0200
changeset 441
7d5a06e32aa8
parent 440
003aa0a78e1e
child 445
26ae21face39

change cxLinkedListCreate() setting all fields instead of calling cxListRecalculateSize()

src/linked_list.c file | annotate | diff | comparison | revisions
--- a/src/linked_list.c	Mon Sep 27 18:57:17 2021 +0200
+++ b/src/linked_list.c	Tue Sep 28 18:09:14 2021 +0200
@@ -203,14 +203,14 @@
     list->base.cmpfunc = comparator;
     list->base.itemsize = item_size;
     list->base.capacity = SIZE_MAX;
+    list->base.size = 0;
 
     list->begin = NULL;
+    list->end = NULL;
     list->loc_prev = CX_LL_LOC_PREV;
     list->loc_next = CX_LL_LOC_NEXT;
 
-    CxList result = (CxList) list;
-    cxLinkedListRecalculateSize(result);
-    return result;
+    return (CxList) list;
 }
 
 void cxLinkedListDestroy(CxList list) {

mercurial