src/array_list.c

changeset 820
8b86ee2e09bb
parent 819
5da2ead43077
child 829
7d4e31d295af
equal deleted inserted replaced
819:5da2ead43077 820:8b86ee2e09bb
325 ((char *) arl->data) + (index + 1) * list->item_size, 325 ((char *) arl->data) + (index + 1) * list->item_size,
326 list->item_size, 326 list->item_size,
327 list->size - index - 1, 327 list->size - index - 1,
328 &arl->reallocator 328 &arl->reallocator
329 ); 329 );
330 if (result == 0) { 330
331 // decrease the size 331 // cx_array_copy cannot fail, array cannot grow
332 list->size--; 332 assert(result == 0);
333 } 333
334 return result; 334 // decrease the size
335 list->size--;
336
337 return 0;
335 } 338 }
336 339
337 static void cx_arl_clear(struct cx_list_s *list) { 340 static void cx_arl_clear(struct cx_list_s *list) {
338 if (list->size == 0) return; 341 if (list->size == 0) return;
339 342

mercurial