750 node = node == NULL ? ((cx_linked_list *) list)->begin : CX_LL_PTR(node, ll->loc_next); |
750 node = node == NULL ? ((cx_linked_list *) list)->begin : CX_LL_PTR(node, ll->loc_next); |
751 |
751 |
752 // we can add the remaining nodes and immediately advance to the inserted node |
752 // we can add the remaining nodes and immediately advance to the inserted node |
753 const char *source = array; |
753 const char *source = array; |
754 for (size_t i = 1; i < n; i++) { |
754 for (size_t i = 1; i < n; i++) { |
755 source += list->collection.elem_size; |
755 if (source != NULL) { |
|
756 source += list->collection.elem_size; |
|
757 } |
756 if (0 != cx_ll_insert_at(list, node, source)) return i; |
758 if (0 != cx_ll_insert_at(list, node, source)) return i; |
757 node = CX_LL_PTR(node, ll->loc_next); |
759 node = CX_LL_PTR(node, ll->loc_next); |
758 } |
760 } |
759 return n; |
761 return n; |
760 } |
762 } |