From 2e074ca9150474fb6d4da2ce1a9cb02bc26d349b Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 22 Mar 2019 09:22:19 +0100 Subject: [PATCH] Remove obsolete function insertchild This function has been obsoleted by the previous commit. Remove it. --- xdu.c | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/xdu.c b/xdu.c index 5b7b33d..4cc3dc7 100644 --- a/xdu.c +++ b/xdu.c @@ -421,55 +421,6 @@ int compare(struct node* n1, struct node* n2, int order) return 0; } -void insertchild(struct node* nodep, struct node* childp, int order) -{ - struct node *np, - *np1; - - if (nodep == NODE_NULL || childp == NODE_NULL) - return; - if (childp->peer != NODE_NULL) { - fprintf(stderr, "xdu: can't insert child with peers\n"); - return; - } - - childp->parent = nodep; - if (nodep->child == NODE_NULL) { - /* - * no children, order doesn't matter - */ - nodep->child = childp; - return; - } - /* - * nodep has at least one child already - */ - if (compare(childp, nodep->child, order) < 0) { - /* - * new first child - */ - childp->peer = nodep->child; - nodep->child = childp; - return; - } - np1 = nodep->child; - for (np = np1->peer; np != NODE_NULL; np = np->peer) { - if (compare(childp, np, order) < 0) { - /* - * insert between np1 and np - */ - childp->peer = np; - np1->peer = childp; - return; - } - np1 = np; - } - /* - * at end, link new child on - */ - np1->peer = childp; -} - /* * add path as a child of top - recursively */