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++) { |