summaryrefslogtreecommitdiff
path: root/content/urldb.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2008-10-10 11:54:37 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2008-10-10 11:54:37 +0000
commiteaa744c0d2f36819438da298600749f0afb09591 (patch)
treef1da9f8b89945c8cb17e28dac9068ff421557de3 /content/urldb.c
parentc4cf8b14cdb4c5d4fd6cf37e2e0cd5223023a8cc (diff)
downloadnetsurf-eaa744c0d2f36819438da298600749f0afb09591.tar.gz
netsurf-eaa744c0d2f36819438da298600749f0afb09591.tar.bz2
Remove urldb_search_remove. Added hint for where to find it if we need it in future
svn path=/trunk/netsurf/; revision=5531
Diffstat (limited to 'content/urldb.c')
-rw-r--r--content/urldb.c58
1 files changed, 1 insertions, 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);
@@ -2027,61 +2026,6 @@ struct search_node *urldb_search_insert_internal(struct search_node *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 = &empty;
- 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
*
* \param root Tree to look in