src/list.c

changeset 1463
e228b5bde7f6
parent 1454
808688e304d5
equal deleted inserted replaced
1462:9263d3f15379 1463:e228b5bde7f6
866 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data) { 866 cx_clone_func clone_func, const CxAllocator *clone_allocator, void *data) {
867 if (clone_allocator == NULL) clone_allocator = cxDefaultAllocator; 867 if (clone_allocator == NULL) clone_allocator = cxDefaultAllocator;
868 868
869 // first, remove existing items from dst when needed 869 // first, remove existing items from dst when needed
870 if (cxCollectionSorted(dst) && cxCollectionSorted(subtrahend)) { 870 if (cxCollectionSorted(dst) && cxCollectionSorted(subtrahend)) {
871 CxIterator sub_iter = cxListIterator(dst);
872 CxIterator dst_iter = cxListIterator(dst); 871 CxIterator dst_iter = cxListIterator(dst);
872 CxIterator sub_iter = cxListIterator(subtrahend);
873 while (cxIteratorValid(dst_iter) && cxIteratorValid(sub_iter)) { 873 while (cxIteratorValid(dst_iter) && cxIteratorValid(sub_iter)) {
874 void *dst_elem = cxIteratorCurrent(dst_iter); 874 void *dst_elem = cxIteratorCurrent(dst_iter);
875 void *sub_elem = cxIteratorCurrent(sub_iter); 875 void *sub_elem = cxIteratorCurrent(sub_iter);
876 cx_compare_func cmp = subtrahend->collection.cmpfunc; 876 cx_compare_func cmp = subtrahend->collection.cmpfunc;
877 int d = cmp(sub_elem, dst_elem); 877 int d = cmp(sub_elem, dst_elem);

mercurial