mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 03:29:14 +00:00
Micro-optimise dangerous condition
Since all ENPASSANT moves are now considered dangerous, this change of order should give a slight speedup. Also simplify futilityValue formula. No functional change.
This commit is contained in:
parent
b71cedb2b0
commit
f026517e5e
1 changed files with 5 additions and 5 deletions
|
@ -807,8 +807,8 @@ moves_loop: // When in check and at SpNode search starts from here
|
|||
captureOrPromotion = pos.capture_or_promotion(move);
|
||||
givesCheck = pos.gives_check(move, ci);
|
||||
dangerous = givesCheck
|
||||
|| pos.advanced_pawn_push(move)
|
||||
|| type_of(move) == CASTLING;
|
||||
|| type_of(move) != NORMAL
|
||||
|| pos.advanced_pawn_push(move);
|
||||
|
||||
// Step 12. Extend checks
|
||||
if (givesCheck && pos.see_sign(move) >= 0)
|
||||
|
@ -1210,9 +1210,9 @@ moves_loop: // When in check and at SpNode search starts from here
|
|||
&& futilityBase > -VALUE_KNOWN_WIN
|
||||
&& !pos.advanced_pawn_push(move))
|
||||
{
|
||||
futilityValue = futilityBase
|
||||
+ PieceValue[EG][pos.piece_on(to_sq(move))]
|
||||
+ (type_of(move) == ENPASSANT ? PawnValueEg : VALUE_ZERO);
|
||||
assert(type_of(move) != ENPASSANT); // Due to !pos.advanced_pawn_push
|
||||
|
||||
futilityValue = futilityBase + PieceValue[EG][pos.piece_on(to_sq(move))];
|
||||
|
||||
if (futilityValue < beta)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue