remove unused cxLinkedListRecalculateSize()

Tue, 05 Oct 2021 13:04:20 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 05 Oct 2021 13:04:20 +0200
changeset 467
95e42a963520
parent 466
28bc3e10ac28
child 468
75ae1dccd101

remove unused cxLinkedListRecalculateSize()

It is not clear what this function was ever supposed to do.

src/cx/linked_list.h file | annotate | diff | comparison | revisions
src/linked_list.c file | annotate | diff | comparison | revisions
--- a/src/cx/linked_list.h	Tue Oct 05 13:03:45 2021 +0200
+++ b/src/cx/linked_list.h	Tue Oct 05 13:04:20 2021 +0200
@@ -77,9 +77,6 @@
  */
 void cxLinkedListDestroy(CxList list);
 
-size_t cxLinkedListRecalculateSize(CxList list);
-
-
 /**
  * Finds the node at a certain index.
  *
--- a/src/linked_list.c	Tue Oct 05 13:03:45 2021 +0200
+++ b/src/linked_list.c	Tue Oct 05 13:04:20 2021 +0200
@@ -332,24 +332,3 @@
 
     cxFree(list->allocator, list);
 }
-
-size_t cxLinkedListRecalculateSize(CxList list) {
-    cx_linked_list *ll = (cx_linked_list *) list;
-
-    if (ll->begin == NULL) {
-        ll->base.size = 0;
-        ll->end = NULL;
-        return 0;
-    } else {
-        cx_linked_list_node *cur = ll->begin;
-        cx_linked_list_node *last;
-        size_t size = 0;
-        do {
-            last = cur;
-            size++;
-        } while ((cur = cur->next) != NULL);
-        ll->end = last;
-        ll->base.size = size;
-        return size;
-    }
-}

mercurial