mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 02:57:11 +08:00
Use frontmost_sq() and backmost_sq helpers
Should easier to read than the lsb() / msb() low level functions. No functional change.
This commit is contained in:
@@ -229,11 +229,11 @@ Value Entry::shelter_storm(const Position& pos, Square ksq) {
|
||||
for (int f = kf - 1; f <= kf + 1; f++)
|
||||
{
|
||||
b = ourPawns & FileBB[f];
|
||||
rkUs = b ? relative_rank(Us, lsb(Us, b)) : RANK_1;
|
||||
rkUs = b ? relative_rank(Us, backmost_sq(Us, b)) : RANK_1;
|
||||
safety -= ShelterWeakness[rkUs];
|
||||
|
||||
b = theirPawns & FileBB[f];
|
||||
rkThem = b ? relative_rank(Us, lsb(Us, b)) : RANK_1;
|
||||
rkThem = b ? relative_rank(Us, frontmost_sq(Them, b)) : RANK_1;
|
||||
safety -= StormDanger[rkUs == RANK_1 ? 0 : rkThem == rkUs + 1 ? 2 : 1][rkThem];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user