improve code in cxArrayListCreate()

Mon, 22 Dec 2025 16:45:58 +0100

author
Mike Becker <universe@uap-core.de>
date
Mon, 22 Dec 2025 16:45:58 +0100
changeset 1657
c6a0381ab9b7
parent 1656
68a03cf89e15
child 1658
71aa6e28a2d7

improve code in cxArrayListCreate()

src/array_list.c file | annotate | diff | comparison | revisions
--- a/src/array_list.c	Mon Dec 22 16:40:24 2025 +0100
+++ b/src/array_list.c	Mon Dec 22 16:45:58 2025 +0100
@@ -1073,13 +1073,11 @@
 
     cx_array_list *list = cxCalloc(allocator, 1, sizeof(cx_array_list));
     if (list == NULL) return NULL;
-    cx_list_init((CxList*)list, &cx_array_list_class,
-        allocator, elem_size);
+    cx_list_init((CxList*)list, &cx_array_list_class, allocator, elem_size);
     list->capacity = initial_capacity;
 
     // allocate the array after the real elem_size is known
-    list->data = cxCalloc(allocator, initial_capacity,
-        list->base.collection.elem_size);
+    list->data = cxCalloc(allocator, initial_capacity, elem_size);
     if (list->data == NULL) { // LCOV_EXCL_START
         cxFree(allocator, list);
         return NULL;

mercurial