]> git.ipfire.org Git - thirdparty/bird.git/blobdiff - lib/lists.c
Birdlib: Do cleanups after remove/free
[thirdparty/bird.git] / lib / lists.c
index d323a4b68d5bbb64a2f6d53199ee5c72a38619ac..20a9a0728e5ac158079c07afeb976ee07611a4ac 100644 (file)
@@ -88,7 +88,7 @@ insert_node(node *n, node *after)
  * rem_node - remove a node from a list
  * @n: node to be removed
  *
- * Removes a node @n from the list it's linked in.
+ * Removes a node @n from the list it's linked in. Afterwards, node @n is cleared.
  */
 LIST_INLINE void
 rem_node(node *n)
@@ -96,23 +96,6 @@ rem_node(node *n)
   node *z = n->prev;
   node *x = n->next;
 
-  z->next = x;
-  x->prev = z;
-}
-
-/**
- * rem2_node - remove a node from a list, with cleanup
- * @n: node to be removed
- *
- * Removes a node @n from the list it's linked in and resets its pointers to NULL.
- * Useful if you want to distinguish between linked and unlinked nodes.
- */
-LIST_INLINE void
-rem2_node(node *n)
-{
-  node *z = n->prev;
-  node *x = n->next;
-
   z->next = x;
   x->prev = z;
   n->next = NULL;