]> git.sesse.net Git - stockfish/commitdiff
Move a comment where it belongs in SEE
authorMarco Costalba <mcostalba@gmail.com>
Fri, 2 Oct 2009 07:33:26 +0000 (08:33 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 3 Oct 2009 09:48:20 +0000 (10:48 +0100)
No functional change of course.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/position.cpp

index 443ba88141b6ae9c3303b4c361efd52c62df64a0..00503429242342be2d9f0587fa73b06b2a0ceab7 100644 (file)
@@ -1321,7 +1321,7 @@ int Position::see(Square from, Square to) const {
     0, 0
   };
 
     0, 0
   };
 
-  Bitboard attackers, stmAttackers, occ, b;
+  Bitboard attackers, stmAttackers, b;
 
   assert(square_is_ok(from) || from == SQ_NONE);
   assert(square_is_ok(to));
 
   assert(square_is_ok(from) || from == SQ_NONE);
   assert(square_is_ok(to));
@@ -1333,10 +1333,7 @@ int Position::see(Square from, Square to) const {
   // Initialize pieces
   Piece piece = piece_on(from);
   Piece capture = piece_on(to);
   // Initialize pieces
   Piece piece = piece_on(from);
   Piece capture = piece_on(to);
-
-  // Find all attackers to the destination square, with the moving piece
-  // removed, but possibly an X-ray attacker added behind it.
-  occ = occupied_squares();
+  Bitboard occ = occupied_squares();
 
   // Handle en passant moves
   if (st->epSquare == to && type_of_piece_on(from) == PAWN)
 
   // Handle en passant moves
   if (st->epSquare == to && type_of_piece_on(from) == PAWN)
@@ -1353,6 +1350,8 @@ int Position::see(Square from, Square to) const {
 
   while (true)
   {
 
   while (true)
   {
+      // Find all attackers to the destination square, with the moving piece
+      // removed, but possibly an X-ray attacker added behind it.
       clear_bit(&occ, from);
       attackers =  (rook_attacks_bb(to, occ)      & pieces(ROOK, QUEEN))
                  | (bishop_attacks_bb(to, occ)    & pieces(BISHOP, QUEEN))
       clear_bit(&occ, from);
       attackers =  (rook_attacks_bb(to, occ)      & pieces(ROOK, QUEEN))
                  | (bishop_attacks_bb(to, occ)    & pieces(BISHOP, QUEEN))