Introduce another two (bitboard,square) operators

And simplify the code.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-02-26 17:34:24 +01:00
parent 8751b18cf0
commit 96eefc4af6
4 changed files with 39 additions and 64 deletions

View File

@@ -1410,13 +1410,11 @@ split_point_start: // At split points actual search starts from here
// Case 5: Discovered check, checking piece is the piece moved in m1
ksq = pos.king_square(pos.side_to_move());
if (piece_is_slider(p1) && (squares_between(t1, ksq) & f2))
{
Bitboard occ = pos.occupied_squares();
occ ^= f2;
if (pos.attacks_from(p1, t1, occ) & ksq)
return true;
}
if ( piece_is_slider(p1)
&& (squares_between(t1, ksq) & f2)
&& (pos.attacks_from(p1, t1, pos.occupied_squares() ^ f2) & ksq))
return true;
return false;
}