1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 11:39:15 +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:
Chris Caino 2013-12-04 15:49:01 +00:00 committed by Marco Costalba
parent b71cedb2b0
commit f026517e5e

View file

@ -807,8 +807,8 @@ moves_loop: // When in check and at SpNode search starts from here
captureOrPromotion = pos.capture_or_promotion(move); captureOrPromotion = pos.capture_or_promotion(move);
givesCheck = pos.gives_check(move, ci); givesCheck = pos.gives_check(move, ci);
dangerous = givesCheck dangerous = givesCheck
|| pos.advanced_pawn_push(move) || type_of(move) != NORMAL
|| type_of(move) == CASTLING; || pos.advanced_pawn_push(move);
// Step 12. Extend checks // Step 12. Extend checks
if (givesCheck && pos.see_sign(move) >= 0) 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 && futilityBase > -VALUE_KNOWN_WIN
&& !pos.advanced_pawn_push(move)) && !pos.advanced_pawn_push(move))
{ {
futilityValue = futilityBase assert(type_of(move) != ENPASSANT); // Due to !pos.advanced_pawn_push
+ PieceValue[EG][pos.piece_on(to_sq(move))]
+ (type_of(move) == ENPASSANT ? PawnValueEg : VALUE_ZERO); futilityValue = futilityBase + PieceValue[EG][pos.piece_on(to_sq(move))];
if (futilityValue < beta) if (futilityValue < beta)
{ {