fix missing documentation if insert_unique member - relates to #557 default tip

Fri, 10 Oct 2025 19:40:24 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 10 Oct 2025 19:40:24 +0200
changeset 1421
809eb30cd621
parent 1420
c6f55a2b3495

fix missing documentation if insert_unique member - relates to #557

docs/Writerside/topics/list.h.md file | annotate | diff | comparison | revisions
--- a/docs/Writerside/topics/list.h.md	Fri Oct 10 19:35:25 2025 +0200
+++ b/docs/Writerside/topics/list.h.md	Fri Oct 10 19:40:24 2025 +0200
@@ -164,7 +164,7 @@
 
 The return values of the array-inserting functions are the number of elements that have been successfully _processed_.
 Usually this is equivalent to the number of inserted elements, except for `cxListInsertUniqueArray()`,
-where the actual number of inserted elements may be less than the number of successfully processed elements.
+where the actual number of inserted elements may be lower than the number of successfully processed elements.
 
 > Implementations are required to optimize the insertion of a sorted array into a sorted list in linear time,
 > while inserting each element separately via `cxListInsertSorted()` may take quadratic time.
@@ -381,6 +381,7 @@
         my_list_insert_element,
         my_list_insert_array,
         my_list_insert_sorted,
+        my_list_insert_unique,
         my_list_insert_iter,
         my_list_remove,
         my_list_clear,
@@ -427,7 +428,8 @@
 | `deallocate`     | Invoke destructor functions on all elements and deallocate the entire list memory.                                                                                                                                                                                                                                         |
 | `insert_element` | Insert a single element at the specified index. Return a pointer to the allocated element or `NULL` on failure.                                                                                                                                                                                                            |
 | `insert_array`   | Insert an array of elements starting at the specified index. Return the number of elements inserted.                                                                                                                                                                                                                       |
-| `insert_sorted`  | Insert an array of sorted elements into a sorted list. Return the number of elements inserted.                                                                                                                                                                                                                             |
+| `insert_sorted`  | Insert an array of sorted elements into a sorted list. Return the number of elements processed (equals the number of elements inserted in this case).                                                                                                                                                                      |
+| `insert_unique`  | Insert an array of sorted unique elements into a sorted list. Return the number of elements processed (not the number of elements inserted, which might be lower).                                                                                                                                                         |
 | `insert_iter`    | Insert a single element depending on the iterator position. The third argument to this function is zero when the element shall be inserted after the iterator position and non-zero if it shall be inserted before the iterator position. The implementation is also responsible for adjusting the iterator, respectively. |
 | `remove`         | Removes a multiple elements starting at the specified index. If a target buffer is specified, copy the elements to that buffer. Otherwise, invoke the destructor functions for the elements. Return the number of elements actually removed.                                                                               |
 | `swap`           | Swap two elements by index. Return zero on success or non-zero when any index was out-of-bounds.                                                                                                                                                                                                                           |
@@ -454,6 +456,7 @@
 |---------------------------------|-----------------------------------------------------------------------------------|
 | `cx_list_default_insert_array`  | Falls back to multiple calls of `insert_element`.                                 |
 | `cx_list_default_insert_sorted` | Uses linear search to find insertion points.                                      |
+| `cx_list_default_insert_unique` | Like `cx_default_insert_sorted` but skips elements that are already contained.    |
 | `cx_list_default_sort`          | Copies all elements to an array, applies `qsort()`, and copies the elements back. |
 | `cx_list_default_swap`          | Uses a temporarily allocated buffer to perform a three-way-swap.                  |
 

mercurial