From eaa744c0d2f36819438da298600749f0afb09591 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 10 Oct 2008 11:54:37 +0000 Subject: Remove urldb_search_remove. Added hint for where to find it if we need it in future svn path=/trunk/netsurf/; revision=5531 --- content/urldb.c | 58 +-------------------------------------------------------- 1 file changed, 1 insertion(+), 57 deletions(-) diff --git a/content/urldb.c b/content/urldb.c index 16f71eed9..a2cdc4eb4 100644 --- a/content/urldb.c +++ b/content/urldb.c @@ -255,8 +255,7 @@ static struct search_node *urldb_search_insert(struct search_node *root, const struct host_part *data); static struct search_node *urldb_search_insert_internal( struct search_node *root, struct search_node *n); -static struct search_node *urldb_search_remove(struct search_node *root, - const struct host_part *data); +/* for urldb_search_remove, see r5531 which removed it */ static const struct host_part *urldb_search_find(struct search_node *root, const char *host); static struct search_node *urldb_search_skew(struct search_node *root); @@ -2026,61 +2025,6 @@ struct search_node *urldb_search_insert_internal(struct search_node *root, return root; } -/** - * Delete a node from a search tree - * - * \param root Tree to remove from - * \param data Data to delete - * \return Updated root of tree - */ -struct search_node *urldb_search_remove(struct search_node *root, - const struct host_part *data) -{ - static struct search_node *last, *deleted; - int c; - - assert(root && data); - - if (root == &empty) - return root; - - c = urldb_search_match_host(root->data, data); - - last = root; - if (c > 0) { - root->left = urldb_search_remove(root->left, data); - } else { - deleted = root; - root->right = urldb_search_remove(root->right, data); - } - - if (root == last) { - if (deleted != &empty && - urldb_search_match_host(deleted->data, - data) == 0) { - deleted->data = last->data; - deleted = ∅ - root = root->right; - free(last); - } - } else { - if (root->left->level < root->level - 1 || - root->right->level < root->level - 1) { - if (root->right->level > --root->level) - root->right->level = root->level; - - root = urldb_search_skew(root); - root->right = urldb_search_skew(root->right); - root->right->right = - urldb_search_skew(root->right->right); - root = urldb_search_split(root); - root->right = urldb_search_split(root->right); - } - } - - return root; -} - /** * Find a node in a search tree * -- cgit v1.2.3