]> git.sesse.net Git - stockfish/blobdiff - src/movegen.cpp
Merge hardware POPCNT detection and use
[stockfish] / src / movegen.cpp
index 1135c21976f416a9bf0116f0936972dc9bde2afe..995f54f06c97b1f352b4cbb2ecfa8f2831070b9d 100644 (file)
@@ -393,7 +393,6 @@ bool move_is_legal(const Position& pos, const Move m, Bitboard pinned) {
   assert(pinned == pos.pinned_pieces(pos.side_to_move()));
 
   Color us = pos.side_to_move();
-  Color them = opposite_color(us);
   Square from = move_from(m);
   Piece pc = pos.piece_on(from);
 
@@ -402,6 +401,7 @@ bool move_is_legal(const Position& pos, const Move m, Bitboard pinned) {
   if (color_of_piece(pc) != us)
       return false;
 
+  Color them = opposite_color(us);
   Square to = move_to(m);
 
   // En passant moves