Skip to content

Commit f4986f4

Browse files
pb00067vondele
authored andcommitted
SEE: simplify stm variable initialization
Pull official-stockfish#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 official-stockfish#3607 No functional change
1 parent 09b6d28 commit f4986f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/position.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,8 +1080,9 @@ bool Position::see_ge(Move m, Value threshold) const {
10801080
if (swap <= 0)
10811081
return true;
10821082

1083+
assert(color_of(piece_on(from)) == sideToMove);
10831084
Bitboard occupied = pieces() ^ from ^ to;
1084-
Color stm = color_of(piece_on(from));
1085+
Color stm = sideToMove;
10851086
Bitboard attackers = attackers_to(to, occupied);
10861087
Bitboard stmAttackers, bb;
10871088
int res = 1;

0 commit comments

Comments
 (0)