From 775417fcee5cdca67bf72e4b4ed3372470b7be2c Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 20 Nov 2016 23:07:51 +0100 Subject: [PATCH] Remove the non-pretty moves from the protobuf, as it takes up a little CPU time for the JavaScript to decode. --- src/client.cpp | 2 +- src/main.cpp | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index a5787905..a59b961a 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -14,7 +14,7 @@ using grpc::Status; using namespace hashprobe; std::string FormatMove(const HashProbeMove &move) { - if (move.from_sq().empty()) return "MOVE_NONE"; + if (move.pretty().empty()) return "MOVE_NONE"; return move.pretty(); } diff --git a/src/main.cpp b/src/main.cpp index 2117497f..3e6369a8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -81,13 +81,6 @@ void HashProbeImpl::FillMove(Position *pos, Move move, HashProbeMove* decoded) { if (type_of(move) == CASTLING) { to = make_square(to > from ? FILE_G : FILE_C, rank_of(from)); } - - decoded->set_from_sq(UCI::square(from)); - decoded->set_to_sq(UCI::square(to)); - - if (type_of(move) == PROMOTION) { - decoded->set_promotion(std::string() + " PNBRQK"[promotion_type(move)]); - } Piece moved_piece = pos->moved_piece(move); std::string pretty; -- 2.39.2