From a08a21d5a0b5aafcdb340364bf73b13d852349a0 Mon Sep 17 00:00:00 2001 From: Henri Wiechers Date: Sat, 18 Jan 2014 13:58:10 +0200 Subject: [PATCH] Small simplification to Position::see Verified there are no hidden bugs and is actually a speed optimization: Fixed games at 15+0.05 TC ELO: 1.72 +-2.9 (95%) LOS: 87.5% Total: 20000 W: 3741 L: 3642 D: 12617 No functional change --- src/position.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 325f3e4db6b..8f38493027b 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1077,7 +1077,6 @@ int Position::see(Move m) const { // Add the new entry to the swap list swapList[slIndex] = -swapList[slIndex - 1] + PieceValue[MG][captured]; - ++slIndex; // Locate and remove the next least valuable attacker captured = min_attacker(byTypeBB, to, stmAttackers, occupied, attackers); @@ -1086,10 +1085,9 @@ int Position::see(Move m) const { // Stop before processing a king capture if (captured == KING && stmAttackers) - { - swapList[slIndex++] = QueenValueMg * 16; break; - } + + ++slIndex; } while (stmAttackers);