src/list.c

changeset 628
1e2be40f0cb5
parent 618
1f5a8f6f3015
child 630
ac5e7f789048
equal deleted inserted replaced
627:cc8cbabd27cd 628:1e2be40f0cb5
55 int cxListCompare( 55 int cxListCompare(
56 CxList const *list, 56 CxList const *list,
57 CxList const *other 57 CxList const *other
58 ) { 58 ) {
59 if (list->cl->compare == other->cl->compare) { 59 if (list->cl->compare == other->cl->compare) {
60 /* same compare function, lists are compatible */ 60 // same compare function, lists are compatible
61 return list->cl->compare(list, other); 61 return list->cl->compare(list, other);
62 } else { 62 } else {
63 /* different compare functions, use iterator */ 63 // different compare functions, use iterator
64 if (list->size == other->size) { 64 if (list->size == other->size) {
65 // TODO: we would need a const iterator 65 // TODO: we would need a const iterator
66 CxIterator left = cxListBegin(list); 66 CxIterator left = cxListBegin(list);
67 CxIterator right = cxListBegin(other); 67 CxIterator right = cxListBegin(other);
68 for (size_t i = 0; i < list->size; i++) { 68 for (size_t i = 0; i < list->size; i++) {

mercurial