From ddeb01612b122bbeeb59a26ba6f8c6f1e4283199 Mon Sep 17 00:00:00 2001 From: Henri Wiechers Date: Sat, 8 Feb 2014 07:46:46 +0200 Subject: [PATCH] Faster handling of king captures in Position::see Another SEE speed up that passed the SPRT short TC test! LLR: 2.96 (-2.94,2.94) [-1.50,4.50] Total: 81337 W: 15060 L: 14745 D: 51532 No functional change. --- src/position.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 8f38493027b..6f874763577 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1080,13 +1080,18 @@ int Position::see(Move m) const { // Locate and remove the next least valuable attacker captured = min_attacker(byTypeBB, to, stmAttackers, occupied, attackers); - stm = ~stm; - stmAttackers = attackers & pieces(stm); // Stop before processing a king capture - if (captured == KING && stmAttackers) + if (captured == KING) + { + if (stmAttackers == attackers) + ++slIndex; + break; + } + stm = ~stm; + stmAttackers = attackers & pieces(stm); ++slIndex; } while (stmAttackers);