Fri, 17 Oct 2025 14:14:21 +0200
make cxCollectionSorted() always return true for empty collections regardless of the sorted flag
src/cx/collection.h | file | annotate | diff | comparison | revisions |
--- a/src/cx/collection.h Thu Oct 16 19:57:47 2025 +0200 +++ b/src/cx/collection.h Fri Oct 17 14:14:21 2025 +0200 @@ -151,7 +151,7 @@ * @retval true if the elements are currently sorted wrt. the collection's compare function * @retval false if the order of elements is unknown */ -#define cxCollectionSorted(c) ((c)->collection.sorted) +#define cxCollectionSorted(c) ((c)->collection.sorted || (c)->collection.size == 0) /** * Sets a simple destructor function for this collection.