From: protonspring Date: Mon, 14 Jan 2019 14:03:31 +0000 (-0700) Subject: Simplify pawn moves (#1900) X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=3732c55c18fd74981370dc55b7b46ec8a05ad5bf Simplify pawn moves (#1900) 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. --- diff --git a/src/movegen.cpp b/src/movegen.cpp index 5ed24893..2f7c55c8 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -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(pawnsNotOn7 & dcCandidates) & emptySquares & ~file_bb(ksq); + Bitboard dc1 = shift(dcCandidateQuiets) & emptySquares & ~file_bb(ksq); Bitboard dc2 = shift(dc1 & TRank3BB) & emptySquares; b1 |= dc1;