Prefer 0 to EmptyBoardBB

Easier and even faster or at least easier to optimize.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2011-12-03 11:56:11 +01:00
parent 5c5af4fa65
commit a44c5cf4f7
9 changed files with 41 additions and 43 deletions

View File

@@ -462,8 +462,8 @@ namespace {
// no minor piece which can exchange the outpost piece.
if (bonus && bit_is_set(ei.attackedBy[Us][PAWN], s))
{
if ( pos.pieces(KNIGHT, Them) == EmptyBoardBB
&& (SquaresByColorBB[color_of(s)] & pos.pieces(BISHOP, Them)) == EmptyBoardBB)
if ( !pos.pieces(KNIGHT, Them)
&& !(SquaresByColorBB[color_of(s)] & pos.pieces(BISHOP, Them)))
bonus += bonus + bonus / 2;
else
bonus += bonus / 2;
@@ -488,7 +488,7 @@ namespace {
const Color Them = (Us == WHITE ? BLACK : WHITE);
const Square* pl = pos.piece_list(Us, Piece);
ei.attackedBy[Us][Piece] = EmptyBoardBB;
ei.attackedBy[Us][Piece] = 0;
while ((s = *pl++) != SQ_NONE)
{