]> git.sesse.net Git - stockfish/commitdiff
Simplify the shelter mask
authorStéphane Nicolet <cassio@free.fr>
Wed, 18 Apr 2018 17:53:39 +0000 (19:53 +0200)
committerStéphane Nicolet <cassio@free.fr>
Wed, 18 Apr 2018 17:53:39 +0000 (19:53 +0200)
The line 246 of pawns.cpp is not necessary, because we restrict the bitboards
to file_of(f) in lines 253 and 256 anyway.

No functional change.

src/pawns.cpp

index 7fcdded6375b92f72beb6db6dd556775d6a44770..7b3dd8181ef9fc602b6868a4eba4a1d1a81bef77 100644 (file)
@@ -240,14 +240,12 @@ Value Entry::shelter_storm(const Position& pos, Square ksq) {
 
   enum { BlockedByKing, Unopposed, BlockedByPawn, Unblocked };
 
 
   enum { BlockedByKing, Unopposed, BlockedByPawn, Unblocked };
 
-  File center = std::max(FILE_B, std::min(FILE_G, file_of(ksq)));
-  Bitboard b =   pos.pieces(PAWN)
-               & (forward_ranks_bb(Us, ksq) | rank_bb(ksq))
-               & (adjacent_files_bb(center) | file_bb(center));
+  Bitboard b = pos.pieces(PAWN) & (forward_ranks_bb(Us, ksq) | rank_bb(ksq));
   Bitboard ourPawns = b & pos.pieces(Us);
   Bitboard theirPawns = b & pos.pieces(Them);
   Value safety = MaxSafetyBonus;
 
   Bitboard ourPawns = b & pos.pieces(Us);
   Bitboard theirPawns = b & pos.pieces(Them);
   Value safety = MaxSafetyBonus;
 
+  File center = std::max(FILE_B, std::min(FILE_G, file_of(ksq)));
   for (File f = File(center - 1); f <= File(center + 1); ++f)
   {
       b = ourPawns & file_bb(f);
   for (File f = File(center - 1); f <= File(center + 1); ++f)
   {
       b = ourPawns & file_bb(f);