src/ucx/linked_list.c

changeset 491
5454ae7bf86b
parent 490
d218607f5a7e
child 504
c094afcdfb27
equal deleted inserted replaced
490:d218607f5a7e 491:5454ae7bf86b
353 void *lc, *ls, *le, *re; 353 void *lc, *ls, *le, *re;
354 354
355 // set start node 355 // set start node
356 ls = *begin; 356 ls = *begin;
357 357
358 // early exit when this list is empty
359 if (ls == NULL) return;
360
358 // check how many elements are already sorted 361 // check how many elements are already sorted
359 lc = ls; 362 lc = ls;
360 size_t ln = 1; 363 size_t ln = 1;
361 while (ll_next(lc) != NULL && cmp_func(ll_data(ll_next(lc)), ll_data(lc)) > 0) { 364 while (ll_next(lc) != NULL && cmp_func(ll_data(ll_next(lc)), ll_data(lc)) > 0) {
362 lc = ll_next(lc); 365 lc = ll_next(lc);

mercurial