src/array_list.c

changeset 622
3d93cd78aa20
parent 620
f220695aded6
child 623
21082350a590
equal deleted inserted replaced
621:646e38efc7bc 622:3d93cd78aa20
270 270
271 static int cx_arl_compare( 271 static int cx_arl_compare(
272 struct cx_list_s const *list, 272 struct cx_list_s const *list,
273 struct cx_list_s const *other 273 struct cx_list_s const *other
274 ) { 274 ) {
275 275 if (list->size == other->size) {
276 char const *left = ((cx_array_list const *) list)->data;
277 char const *right = ((cx_array_list const *) other)->data;
278 for (size_t i = 0; i < list->size; i++) {
279 int d = list->cmpfunc(left, right);
280 if (d != 0) {
281 return d;
282 }
283 left += list->itemsize;
284 right += other->itemsize;
285 }
286 return 0;
287 } else {
288 return list->size < other->size ? -1 : 1;
289 }
276 } 290 }
277 291
278 static void cx_arl_reverse(struct cx_list_s *list) { 292 static void cx_arl_reverse(struct cx_list_s *list) {
279 293
280 } 294 }

mercurial