Skip to content

Commit a08a21d

Browse files
Henri Wiechersmcostalba
Henri Wiechers
authored andcommitted
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
1 parent cabd512 commit a08a21d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/position.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,6 @@ int Position::see(Move m) const {
10771077

10781078
// Add the new entry to the swap list
10791079
swapList[slIndex] = -swapList[slIndex - 1] + PieceValue[MG][captured];
1080-
++slIndex;
10811080

10821081
// Locate and remove the next least valuable attacker
10831082
captured = min_attacker<PAWN>(byTypeBB, to, stmAttackers, occupied, attackers);
@@ -1086,10 +1085,9 @@ int Position::see(Move m) const {
10861085

10871086
// Stop before processing a king capture
10881087
if (captured == KING && stmAttackers)
1089-
{
1090-
swapList[slIndex++] = QueenValueMg * 16;
10911088
break;
1092-
}
1089+
1090+
++slIndex;
10931091

10941092
} while (stmAttackers);
10951093

0 commit comments

Comments
 (0)