src/cx/collection.h

changeset 1427
943bfd9e7978
parent 1424
563033aa998c
--- 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.

mercurial