From: Marco Costalba Date: Sun, 21 Oct 2012 12:03:44 +0000 (+0200) Subject: Don't need to init board[] with NO_PIECE X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=dbbbd3880cc13ee5cf07390fbe1be07121abe613;hp=e40b06a0503b44bae5508a371d961914828214b6 Don't need to init board[] with NO_PIECE Now that NO_PIECE == 0 the common memset() will do the work. No functional change. --- diff --git a/src/position.cpp b/src/position.cpp index b3e86c85..c693b660 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1347,9 +1347,6 @@ void Position::clear() { for (int i = 0; i < 8; i++) for (int j = 0; j < 16; j++) pieceList[0][i][j] = pieceList[1][i][j] = SQ_NONE; - - for (Square sq = SQ_A1; sq <= SQ_H8; sq++) - board[sq] = NO_PIECE; } diff --git a/src/types.h b/src/types.h index d4ebec9f..1842eb2a 100644 --- a/src/types.h +++ b/src/types.h @@ -440,11 +440,11 @@ inline int square_distance(Square s1, Square s2) { } inline char file_to_char(File f) { - return char(f - FILE_A + int('a')); + return char(f - FILE_A + 'a'); } inline char rank_to_char(Rank r) { - return char(r - RANK_1 + int('1')); + return char(r - RANK_1 + '1'); } inline Square pawn_push(Color c) {