From f4986f45967c613d92657f46b5a50f12dae15398 Mon Sep 17 00:00:00 2001 From: pb00067 Date: Wed, 7 Jul 2021 14:32:54 +0200 Subject: [PATCH] SEE: simplify stm variable initialization 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/position.cpp b/src/position.cpp index ba015d3c..0686d245 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -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; -- 2.39.2