Small cleanups

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

No functional change
This commit is contained in:
Joost VandeVondele
2020-04-12 20:30:08 +02:00
parent 195a4fec6d
commit f83cb95740
11 changed files with 48 additions and 54 deletions

View File

@@ -277,16 +277,13 @@ ExtMove* generate<QUIET_CHECKS>(const Position& pos, ExtMove* moveList) {
assert(!pos.checkers());
Color us = pos.side_to_move();
Bitboard dc = pos.blockers_for_king(~us) & pos.pieces(us);
Bitboard dc = pos.blockers_for_king(~us) & pos.pieces(us) & ~pos.pieces(PAWN);
while (dc)
{
Square from = pop_lsb(&dc);
PieceType pt = type_of(pos.piece_on(from));
if (pt == PAWN)
continue; // Will be generated together with direct checks
Bitboard b = pos.attacks_from(pt, from) & ~pos.pieces();
if (pt == KING)
@@ -317,10 +314,7 @@ ExtMove* generate<EVASIONS>(const Position& pos, ExtMove* moveList) {
// the king evasions in order to skip known illegal moves, which avoids any
// useless legality checks later on.
while (sliders)
{
Square checksq = pop_lsb(&sliders);
sliderAttacks |= LineBB[ksq][checksq] ^ checksq;
}
sliderAttacks |= LineBB[ksq][pop_lsb(&sliders)] & ~pos.checkers();
// Generate evasions for king, capture and non capture moves
Bitboard b = pos.attacks_from<KING>(ksq) & ~pos.pieces(us) & ~sliderAttacks;