src/array_list.c

changeset 1531
3ee5a5c7823a
parent 1509
0437871200d6
equal deleted inserted replaced
1530:77cb6540d9d8 1531:3ee5a5c7823a
518 while (si < elem_count) { 518 while (si < elem_count) {
519 // find a chain of elements that can be copied 519 // find a chain of elements that can be copied
520 size_t copy_len = 1, skip_len = 0; 520 size_t copy_len = 1, skip_len = 0;
521 { 521 {
522 const char *left_src = src; 522 const char *left_src = src;
523 while (si + copy_len < elem_count) { 523 while (si + copy_len + skip_len < elem_count) {
524 const char *right_src = left_src + elem_size; 524 const char *right_src = left_src + elem_size;
525 int d = cmp_func(left_src, right_src); 525 int d = cmp_func(left_src, right_src);
526 if (d < 0) { 526 if (d < 0) {
527 if (skip_len > 0) { 527 if (skip_len > 0) {
528 // new larger element found; 528 // new larger element found;

mercurial