Skip to content

Commit ddeb016

Browse files
Henri Wiechersmcostalba
authored andcommitted
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.
1 parent 41641e3 commit ddeb016

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/position.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,13 +1080,18 @@ int Position::see(Move m) const {
10801080

10811081
// Locate and remove the next least valuable attacker
10821082
captured = min_attacker<PAWN>(byTypeBB, to, stmAttackers, occupied, attackers);
1083-
stm = ~stm;
1084-
stmAttackers = attackers & pieces(stm);
10851083

10861084
// Stop before processing a king capture
1087-
if (captured == KING && stmAttackers)
1085+
if (captured == KING)
1086+
{
1087+
if (stmAttackers == attackers)
1088+
++slIndex;
1089+
10881090
break;
1091+
}
10891092

1093+
stm = ~stm;
1094+
stmAttackers = attackers & pieces(stm);
10901095
++slIndex;
10911096

10921097
} while (stmAttackers);

0 commit comments

Comments
 (0)