Skip to content

Commit 04fd7ef

Browse files
R-Pelegmcostalba
authored andcommitted
Simplify kf definition in shelter_storm()
No functional change.
1 parent 5e331f9 commit 04fd7ef

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/pawns.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,7 @@ Value Entry::shelter_storm(const Position& pos, Square ksq) {
226226
Bitboard ourPawns = b & pos.pieces(Us);
227227
Bitboard theirPawns = b & pos.pieces(Them);
228228
Rank rkUs, rkThem;
229-
File kf = file_of(ksq);
230-
231-
kf = (kf == FILE_A) ? FILE_B : (kf == FILE_H) ? FILE_G : kf;
229+
File kf = std::max(FILE_B, std::min(FILE_G, file_of(ksq)));
232230

233231
for (int f = kf - 1; f <= kf + 1; f++)
234232
{

0 commit comments

Comments
 (0)