mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 18:46:59 +08:00
Assorted trivial cleanups 4/2019
No functional change.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
#include "bitboard.h"
|
||||
@@ -175,14 +176,14 @@ Value Entry::evaluate_shelter(const Position& pos, Square ksq) {
|
||||
|
||||
constexpr Color Them = (Us == WHITE ? BLACK : WHITE);
|
||||
constexpr Direction Down = (Us == WHITE ? SOUTH : NORTH);
|
||||
constexpr Bitboard BlockRanks = (Us == WHITE ? Rank1BB | Rank2BB : Rank8BB | Rank7BB);
|
||||
constexpr Bitboard BlockSquares = (Rank1BB | Rank2BB | Rank7BB | Rank8BB)
|
||||
& (FileABB | FileHBB);
|
||||
|
||||
Bitboard b = pos.pieces(PAWN) & ~forward_ranks_bb(Them, ksq);
|
||||
Bitboard ourPawns = b & pos.pieces(Us);
|
||||
Bitboard theirPawns = b & pos.pieces(Them);
|
||||
|
||||
Value safety = (shift<Down>(theirPawns) & (FileABB | FileHBB) & BlockRanks & ksq) ?
|
||||
Value(374) : Value(5);
|
||||
Value safety = (shift<Down>(theirPawns) & BlockSquares & ksq) ? Value(374) : Value(5);
|
||||
|
||||
File center = clamp(file_of(ksq), FILE_B, FILE_G);
|
||||
for (File f = File(center - 1); f <= File(center + 1); ++f)
|
||||
|
||||
Reference in New Issue
Block a user