1.1 --- a/src/array_list.c Wed Jan 25 19:19:29 2023 +0100 1.2 +++ b/src/array_list.c Thu Jan 26 20:59:36 2023 +0100 1.3 @@ -224,6 +224,14 @@ 1.4 } 1.5 } 1.6 1.7 +static int cx_arl_insert_element( 1.8 + struct cx_list_s *list, 1.9 + size_t index, 1.10 + void const *element 1.11 +) { 1.12 + return 1 != cx_arl_insert_array(list, index, element, 1); 1.13 +} 1.14 + 1.15 static int cx_arl_insert_iter( 1.16 struct cx_mut_iterator_s *iter, 1.17 void const *elem, 1.18 @@ -231,11 +239,10 @@ 1.19 ) { 1.20 struct cx_list_s *list = iter->src_handle; 1.21 if (iter->index < list->size) { 1.22 - int result = 1 != cx_arl_insert_array( 1.23 + int result = cx_arl_insert_element( 1.24 list, 1.25 iter->index + 1 - prepend, 1.26 - elem, 1.27 - 1 1.28 + elem 1.29 ); 1.30 if (result == 0 && prepend != 0) { 1.31 iter->index++; 1.32 @@ -243,7 +250,7 @@ 1.33 } 1.34 return result; 1.35 } else { 1.36 - int result = 1 != cx_arl_insert_array(list, list->size, elem, 1); 1.37 + int result = cx_arl_insert_element(list, list->size, elem); 1.38 iter->index = list->size; 1.39 return result; 1.40 } 1.41 @@ -407,6 +414,7 @@ 1.42 1.43 static cx_list_class cx_array_list_class = { 1.44 cx_arl_destructor, 1.45 + cx_arl_insert_element, 1.46 cx_arl_insert_array, 1.47 cx_arl_insert_iter, 1.48 cx_arl_remove,