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:
Marco Costalba
2013-08-30 07:05:25 +02:00
parent 5d90c149b5
commit 14f47c8ac6
3 changed files with 11 additions and 9 deletions

View File

@@ -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];
}