Skip to content

Commit

Permalink
Faster handling of king captures in Position::see
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Henri Wiechers authored and mcostalba committed Feb 9, 2014
1 parent 41641e3 commit ddeb016
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1080,13 +1080,18 @@ int Position::see(Move m) const {

// Locate and remove the next least valuable attacker
captured = min_attacker<PAWN>(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);
Expand Down

0 comments on commit ddeb016

Please sign in to comment.