Mon, 22 Dec 2025 16:45:58 +0100
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;