# HG changeset patch # User Mike Becker # Date 1684670674 -7200 # Node ID 0d5447230044ed4981f2b1eae12e9756814da7a8 # Parent 35f06c5eeb0ec5f2030b0aee4bbde16a576c2a05 fix cxListCompare if-condition diff -r 35f06c5eeb0e -r 0d5447230044 src/list.c --- a/src/list.c Sun May 21 14:03:21 2023 +0200 +++ b/src/list.c Sun May 21 14:04:34 2023 +0200 @@ -298,10 +298,17 @@ CxList const *list, CxList const *other ) { - if ((list->store_pointer ^ other->store_pointer) || - ((list->climpl == NULL) ^ (other->climpl != NULL)) || + if ( + // if one is storing pointers but the other is not + (list->store_pointer ^ other->store_pointer) || + + // if one class is wrapped but the other is not + ((list->climpl == NULL) ^ (other->climpl == NULL)) || + + // if the resolved compare functions are not the same ((list->climpl != NULL ? list->climpl->compare : list->cl->compare) != - (other->climpl != NULL ? other->climpl->compare : other->cl->compare))) { + (other->climpl != NULL ? other->climpl->compare : other->cl->compare)) + ) { // lists are definitely different - cannot use internal compare function if (list->size == other->size) { CxIterator left = cxListIterator(list);