mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 17:19:36 +00:00
Slightly microptimize SEE
Reduce of one instruction. It seems a tad faster on the profiler now. Very slightly but anyhow it is a code semplification. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
7a2825053e
commit
fde0b9e701
1 changed files with 1 additions and 2 deletions
|
@ -1271,12 +1271,11 @@ int Position::see(Move m) const {
|
||||||
// Locate the least valuable attacker for the side to move. The loop
|
// Locate the least valuable attacker for the side to move. The loop
|
||||||
// below looks like it is potentially infinite, but it isn't. We know
|
// below looks like it is potentially infinite, but it isn't. We know
|
||||||
// that the side to move still has at least one attacker left.
|
// that the side to move still has at least one attacker left.
|
||||||
for (pt = PAWN; !(stmAttackers & pieces(pt)); pt++)
|
for (pt = PAWN; (b = stmAttackers & pieces(pt)) == 0; pt++)
|
||||||
assert(pt < KING);
|
assert(pt < KING);
|
||||||
|
|
||||||
// Remove the attacker we just found from the 'occupied' bitboard,
|
// Remove the attacker we just found from the 'occupied' bitboard,
|
||||||
// and scan for new X-ray attacks behind the attacker.
|
// and scan for new X-ray attacks behind the attacker.
|
||||||
b = stmAttackers & pieces(pt);
|
|
||||||
occ ^= (b & (~b + 1));
|
occ ^= (b & (~b + 1));
|
||||||
attackers |= (attacks_bb<ROOK>(to, occ) & pieces(ROOK, QUEEN))
|
attackers |= (attacks_bb<ROOK>(to, occ) & pieces(ROOK, QUEEN))
|
||||||
| (attacks_bb<BISHOP>(to, occ) & pieces(BISHOP, QUEEN));
|
| (attacks_bb<BISHOP>(to, occ) & pieces(BISHOP, QUEEN));
|
||||||
|
|
Loading…
Add table
Reference in a new issue