From afea3959d66ee578bd4e49dc3069b369bd89dfb7 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sun, 4 Apr 2010 00:09:09 +0200 Subject: [PATCH] uct_search(): Move some variable declarations inside the loop --- uct/uct.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/uct/uct.c b/uct/uct.c index 757e82f..d611889 100644 --- a/uct/uct.c +++ b/uct/uct.c @@ -635,11 +635,6 @@ uct_search(struct uct *u, struct board *b, struct time_info *ti, enum stone colo * count. However, TM_ROOT just does not deserve any more extra code * right now. */ - struct tree_node *best = NULL; - struct tree_node *best2 = NULL; // Second-best move. - struct tree_node *bestr = NULL; // best's best child. - struct tree_node *winner = NULL; - /* Now, just periodically poll the search tree. */ while (1) { time_sleep(TREE_BUSYWAIT_INTERVAL); @@ -679,6 +674,11 @@ uct_search(struct uct *u, struct board *b, struct time_info *ti, enum stone colo if (i < GJ_MINGAMES) continue; + struct tree_node *best = NULL; + struct tree_node *best2 = NULL; // Second-best move. + struct tree_node *bestr = NULL; // best's best child. + struct tree_node *winner = NULL; + best = u->policy->choose(u->policy, ctx->t->root, b, color, resign); if (best) best2 = u->policy->choose(u->policy, ctx->t->root, b, color, best->coord); -- 2.11.4.GIT