# HG changeset patch # User Mike Becker # Date 1760703261 -7200 # Node ID 943bfd9e797834cbe6f5bd837b4bed2d906d23e5 # Parent 3a89b31f0724229174c70cfa4cb9878d8d3a908f make cxCollectionSorted() always return true for empty collections regardless of the sorted flag diff -r 3a89b31f0724 -r 943bfd9e7978 src/cx/collection.h --- 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.