From f70860fbfad1fbd50e7667f2977abefb5ca3d8a3 Mon Sep 17 00:00:00 2001 From: Jean-loup Gailly Date: Mon, 5 Apr 2010 15:23:55 +0200 Subject: [PATCH] Distributed engine: do not resend same command if slave did it successfully. --- distributed/distributed.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/distributed/distributed.c b/distributed/distributed.c index 293559b..132dd75 100644 --- a/distributed/distributed.c +++ b/distributed/distributed.c @@ -273,7 +273,13 @@ process_reply(int reply_id, char *reply, char *reply_buf, for (int slot = 0; slot < MAX_CMDS_PER_MOVE; slot++) { if (reply_id == id_history[reply_move][slot]) { - return cmd_history[reply_move][slot]; + char *to_send = cmd_history[reply_move][slot]; + + /* Do not resend same cmd if done successfully. */ + if (*reply != '=') return to_send; + to_send = strchr(to_send, '\n'); + assert(to_send && to_send[1]); + return to_send+1; } } return gtp_cmds; -- 2.11.4.GIT