Skip to content

Commit

Permalink
Simplify pawn moves (official-stockfish#1900)
Browse files Browse the repository at this point in the history
If we define dcCandidates with & pawnsNotOn7, 
we don't have to & it both times.

This seems more clear to me as well.

Tested for no regression.
STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 44042 W: 9663 L: 9585 D: 24794
http://tests.stockfishchess.org/tests/view/5c21d9120ebc5902ba12e84d

No functional change.
  • Loading branch information
protonspring authored and mcostalba committed Jan 14, 2019
1 parent 230fb6e commit 3732c55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/movegen.cpp
Expand Up @@ -93,10 +93,10 @@ namespace {
// if the pawn is not on the same file as the enemy king, because we
// don't generate captures. Note that a possible discovery check
// promotion has been already generated amongst the captures.
Bitboard dcCandidates = pos.blockers_for_king(Them);
if (pawnsNotOn7 & dcCandidates)
Bitboard dcCandidateQuiets = pos.blockers_for_king(Them) & pawnsNotOn7;
if (dcCandidateQuiets)
{
Bitboard dc1 = shift<Up>(pawnsNotOn7 & dcCandidates) & emptySquares & ~file_bb(ksq);
Bitboard dc1 = shift<Up>(dcCandidateQuiets) & emptySquares & ~file_bb(ksq);
Bitboard dc2 = shift<Up>(dc1 & TRank3BB) & emptySquares;

b1 |= dc1;
Expand Down

0 comments on commit 3732c55

Please sign in to comment.