]> git.sesse.net Git - stockfish/commitdiff
SEE: simplify stm variable initialization
authorpb00067 <pb00067@PHXL0356.wp.lan>
Wed, 7 Jul 2021 12:32:54 +0000 (14:32 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Tue, 13 Jul 2021 15:31:15 +0000 (17:31 +0200)
Pull #3458 removed the only usage of pos.see_ge() moving pieces that
don't belong to the side to move, so we can simplify this, adding an assert.

closes https://github.com/official-stockfish/Stockfish/pull/3607

No functional change

src/position.cpp

index ba015d3c38edb3cf87be062f952f4fbcec568cc4..0686d245bc77fe956f3a8e15a7f86360e610c38d 100644 (file)
@@ -1080,8 +1080,9 @@ bool Position::see_ge(Move m, Value threshold) const {
   if (swap <= 0)
       return true;
 
+  assert(color_of(piece_on(from)) == sideToMove);
   Bitboard occupied = pieces() ^ from ^ to;
-  Color stm = color_of(piece_on(from));
+  Color stm = sideToMove;
   Bitboard attackers = attackers_to(to, occupied);
   Bitboard stmAttackers, bb;
   int res = 1;