ucx/cx/collection.h

changeset 870
e167cf006213
parent 845
f3ab28ed22e5
child 943
9b5948aa5b90
--- a/ucx/cx/collection.h	Tue Oct 21 12:34:17 2025 +0200
+++ b/ucx/cx/collection.h	Tue Oct 21 16:20:51 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