mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Revert "Remove confusing optimization"
This reverts commit e05c80a088
.
we gain a speed up of 1.5% under gcc !
No functional change.
This commit is contained in:
parent
2d82db1d14
commit
12c0dfc113
1 changed files with 2 additions and 1 deletions
|
@ -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,
|
// 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
|
// 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.
|
// 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;
|
unsafeSquares = squaresToQueen;
|
||||||
else
|
else
|
||||||
unsafeSquares = squaresToQueen & (ei.attackedBy[Them][ALL_PIECES] | pos.pieces(Them));
|
unsafeSquares = squaresToQueen & (ei.attackedBy[Them][ALL_PIECES] | pos.pieces(Them));
|
||||||
|
|
Loading…
Add table
Reference in a new issue