]> git.sesse.net Git - stockfish/commit
Refactor do_castle()
authorDan Schmidt <dfan@dfan.org>
Sat, 3 Aug 2013 12:42:58 +0000 (08:42 -0400)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 3 Aug 2013 14:18:28 +0000 (16:18 +0200)
commitf7096ea7cedeb81d9799e4440a670736825c6a7e
tree15bf4d7f44d7ffaad851b9df7d04228ff3d43b86
parenta16ba5bbd1034417f864476e4ba33d35970557db
Refactor do_castle()

Not a real functional change, but bench changed due to different piecelist
reordering. To verify it a temporary my canonicalize_rooks function was
written as follows. It just ensures that the rook on the "smaller" square
is listed first.

void Position::canonicalize_rooks(Color c)
{
   if (pieceCount[c][ROOK] == 2)
   {
      Square s0 = pieceList[c][ROOK][0];
      Square s1 = pieceList[c][ROOK][1];
      if (s0 > s1)
      {
         pieceList[c][ROOK][0] = s1;
         pieceList[c][ROOK][1] = s0;
         index[s0] = 1;
         index[s1] = 0;
      }
   }
}

With this both bench and the test on Chess960 positions

./stockfish bench 128 1 8 Chess960.epd file > /dev/null

Gives same result.

bench: 4424151
src/position.cpp