From 10886dd81bbaf3b6132a1a4acf0e4c977c484329 Mon Sep 17 00:00:00 2001 From: Jean-loup Gailly Date: Thu, 4 Feb 2010 16:49:09 +0100 Subject: [PATCH] Suppress unused tree_get_node(). --- uct/tree.c | 38 -------------------------------------- uct/tree.h | 1 - 2 files changed, 39 deletions(-) diff --git a/uct/tree.c b/uct/tree.c index 37d1615..94df30c 100644 --- a/uct/tree.c +++ b/uct/tree.c @@ -424,44 +424,6 @@ tree_normalize(struct tree *tree, int factor) } -/* Get a node of given coordinate from within parent, possibly creating it - * if necessary - in a very raw form (no .d, priors, ...). */ -/* FIXME: Adjust for board symmetry. */ -struct tree_node * -tree_get_node(struct tree *t, struct tree_node *parent, coord_t c, bool create) -{ - if (!parent->children || parent->children->coord >= c) { - /* Special case: Insertion at the beginning. */ - if (parent->children && parent->children->coord == c) - return parent->children; - if (!create) - return NULL; - - struct tree_node *nn = tree_init_node(t, c, parent->depth + 1); - nn->parent = parent; nn->sibling = parent->children; - parent->children = nn; - return nn; - } - - /* No candidate at the beginning, look through all the children. */ - - struct tree_node *ni; - for (ni = parent->children; ni->sibling; ni = ni->sibling) - if (ni->sibling->coord >= c) - break; - - if (ni->sibling && ni->sibling->coord == c) - return ni->sibling; - assert(ni->coord < c); - if (!create) - return NULL; - - struct tree_node *nn = tree_init_node(t, c, parent->depth + 1); - nn->parent = parent; nn->sibling = ni->sibling; ni->sibling = nn; - return nn; -} - - /* Tree symmetry: When possible, we will localize the tree to a single part * of the board in tree_expand_node() and possibly flip along symmetry axes * to another part of the board in tree_promote_at(). We follow b->symmetry diff --git a/uct/tree.h b/uct/tree.h index 5009351..2320235 100644 --- a/uct/tree.h +++ b/uct/tree.h @@ -82,7 +82,6 @@ void tree_merge(struct tree *dest, struct tree *src); void tree_normalize(struct tree *tree, int factor); /* Warning: All these functions are THREAD-UNSAFE! */ -struct tree_node *tree_get_node(struct tree *tree, struct tree_node *node, coord_t c, bool create); void tree_expand_node(struct tree *tree, struct tree_node *node, struct board *b, enum stone color, struct uct *u, int parity); void tree_promote_node(struct tree *tree, struct tree_node *node); bool tree_promote_at(struct tree *tree, struct board *b, coord_t c); -- 2.11.4.GIT