Speed Up Perft Search

It speeds up generate<LEGAL>, and thus perft, roughly by 2-3%.

closes https://github.com/official-stockfish/Stockfish/pull/3312

No functional change
This commit is contained in:
bmc4
2021-01-19 09:21:59 -03:00
committed by Joost VandeVondele
parent befbcffb4e
commit 0db374777e

View File

@@ -354,7 +354,7 @@ ExtMove* generate<LEGAL>(const Position& pos, ExtMove* moveList) {
moveList = pos.checkers() ? generate<EVASIONS >(pos, moveList)
: generate<NON_EVASIONS>(pos, moveList);
while (cur != moveList)
if ( (pinned || from_sq(*cur) == ksq || type_of(*cur) == EN_PASSANT)
if ( ((pinned && pinned & from_sq(*cur)) || from_sq(*cur) == ksq || type_of(*cur) == EN_PASSANT)
&& !pos.legal(*cur))
*cur = (--moveList)->move;
else