]> git.sesse.net Git - stockfish/commitdiff
Don't need to init board[] with NO_PIECE
authorMarco Costalba <mcostalba@gmail.com>
Sun, 21 Oct 2012 12:03:44 +0000 (14:03 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 21 Oct 2012 22:38:12 +0000 (00:38 +0200)
Now that NO_PIECE == 0 the common memset() will
do the work.

No functional change.

src/position.cpp
src/types.h

index b3e86c853f0a90ebb58fb565d2785e5ed30711b6..c693b660cc7c3a7a80fa7f6502a17fa16d5c64a7 100644 (file)
@@ -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 (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;
 }
 
 
 }
 
 
index d4ebec9f06fe977fa0d5df482fecab850af063f3..1842eb2a3ea1eb2b08b9663644f575a7b4347256 100644 (file)
@@ -440,11 +440,11 @@ inline int square_distance(Square s1, Square s2) {
 }
 
 inline char file_to_char(File f) {
 }
 
 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) {
 }
 
 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) {
 }
 
 inline Square pawn_push(Color c) {