Skip to content

Commit

Permalink
Small simplification to Position::see
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Henri Wiechers authored and mcostalba committed Jan 19, 2014
1 parent cabd512 commit a08a21d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<PAWN>(byTypeBB, to, stmAttackers, occupied, attackers);
Expand All @@ -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);

Expand Down

0 comments on commit a08a21d

Please sign in to comment.