remove check that is always true in cx_arl_remove()

Fri, 26 Jan 2024 19:17:46 +0100

author
Mike Becker <universe@uap-core.de>
date
Fri, 26 Jan 2024 19:17:46 +0100
changeset 820
8b86ee2e09bb
parent 819
5da2ead43077
child 821
5e6f15005efd

remove check that is always true in cx_arl_remove()

src/array_list.c file | annotate | diff | comparison | revisions
--- a/src/array_list.c	Thu Jan 25 22:05:48 2024 +0100
+++ b/src/array_list.c	Fri Jan 26 19:17:46 2024 +0100
@@ -327,11 +327,14 @@
             list->size - index - 1,
             &arl->reallocator
     );
-    if (result == 0) {
-        // decrease the size
-        list->size--;
-    }
-    return result;
+
+    // cx_array_copy cannot fail, array cannot grow
+    assert(result == 0);
+
+    // decrease the size
+    list->size--;
+
+    return 0;
 }
 
 static void cx_arl_clear(struct cx_list_s *list) {

mercurial