From 56d6aa2a86f9cad689b69707df9cb19b6f5275b5 Mon Sep 17 00:00:00 2001 From: bmc4 Date: Sat, 21 Aug 2021 01:53:03 -0300 Subject: [PATCH] Simplify Declaration on Pawn Move Generation Removes possible micro-optimization in favor of readability. STC: LLR: 2.95 (-2.94,2.94) <-2.50,0.50> Total: 75432 W: 5824 L: 5777 D: 63831 Ptnml(0-2): 178, 4648, 28036, 4657, 197 https://tests.stockfishchess.org/tests/view/611fa7f84977aa1525c9cb75 LTC: LLR: 2.93 (-2.94,2.94) <-2.50,0.50> Total: 41200 W: 1156 L: 1106 D: 38938 Ptnml(0-2): 13, 981, 18562, 1031, 13 https://tests.stockfishchess.org/tests/view/611fcc694977aa1525c9cb9b Closes https://github.com/official-stockfish/Stockfish/pull/3669 No functional change --- src/movegen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/movegen.cpp b/src/movegen.cpp index 5f3ba90a479..5095bb7455e 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -52,9 +52,9 @@ namespace { constexpr Direction UpRight = (Us == WHITE ? NORTH_EAST : SOUTH_WEST); constexpr Direction UpLeft = (Us == WHITE ? NORTH_WEST : SOUTH_EAST); - const Bitboard emptySquares = Type == QUIETS || Type == QUIET_CHECKS ? target : ~pos.pieces(); - const Bitboard enemies = Type == EVASIONS ? pos.checkers() - : Type == CAPTURES ? target : pos.pieces(Them); + const Bitboard emptySquares = ~pos.pieces(); + const Bitboard enemies = Type == EVASIONS ? pos.checkers() + : pos.pieces(Them); Bitboard pawnsOn7 = pos.pieces(Us, PAWN) & TRank7BB; Bitboard pawnsNotOn7 = pos.pieces(Us, PAWN) & ~TRank7BB;