Skip to content

Commit

Permalink
Revert "Remove confusing optimization"
Browse files Browse the repository at this point in the history
This reverts commit e05c80a.

we gain a speed up of 1.5% under gcc !

No functional change.
  • Loading branch information
mcostalba committed Jul 2, 2013
1 parent 2d82db1 commit 12c0dfc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/evaluate.cpp
Expand Up @@ -821,7 +821,8 @@ Value do_evaluate(const Position& pos, Value& margin) {
// If there is an enemy rook or queen attacking the pawn from behind,
// add all X-ray attacks by the rook or queen. Otherwise consider only
// the squares in the pawn's path attacked or occupied by the enemy.
if (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN) & pos.attacks_from<ROOK>(s))
if ( (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN)) // Unlikely
&& (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN) & pos.attacks_from<ROOK>(s)))
unsafeSquares = squaresToQueen;
else
unsafeSquares = squaresToQueen & (ei.attackedBy[Them][ALL_PIECES] | pos.pieces(Them));
Expand Down

0 comments on commit 12c0dfc

Please sign in to comment.