mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 09:37:16 +08:00
Rewrite previous patch removing the macro
No functional change.
This commit is contained in:
@@ -51,12 +51,6 @@ using std::string;
|
|||||||
using Eval::evaluate;
|
using Eval::evaluate;
|
||||||
using namespace Search;
|
using namespace Search;
|
||||||
|
|
||||||
// Fast wrapper for common case of pos.gives_check()
|
|
||||||
#define FAST_GIVES_CHECK(pos, m, ci) \
|
|
||||||
((type_of(m) == NORMAL && ci.dcCandidates == 0) \
|
|
||||||
? (ci.checkSq[type_of(pos.piece_on(from_sq(m)))] & to_sq(m)) \
|
|
||||||
: pos.gives_check(m, ci))
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// Set to true to force running with one thread. Used for debugging
|
// Set to true to force running with one thread. Used for debugging
|
||||||
@@ -760,7 +754,11 @@ moves_loop: // When in check and at SpNode search starts from here
|
|||||||
|
|
||||||
ext = DEPTH_ZERO;
|
ext = DEPTH_ZERO;
|
||||||
captureOrPromotion = pos.capture_or_promotion(move);
|
captureOrPromotion = pos.capture_or_promotion(move);
|
||||||
givesCheck = FAST_GIVES_CHECK(pos, move, ci);
|
|
||||||
|
givesCheck = type_of(move) == NORMAL && !ci.dcCandidates
|
||||||
|
? ci.checkSq[type_of(pos.piece_on(from_sq(move)))] & to_sq(move)
|
||||||
|
: pos.gives_check(move, ci);
|
||||||
|
|
||||||
dangerous = givesCheck
|
dangerous = givesCheck
|
||||||
|| type_of(move) != NORMAL
|
|| type_of(move) != NORMAL
|
||||||
|| pos.advanced_pawn_push(move);
|
|| pos.advanced_pawn_push(move);
|
||||||
@@ -1140,7 +1138,9 @@ moves_loop: // When in check and at SpNode search starts from here
|
|||||||
{
|
{
|
||||||
assert(is_ok(move));
|
assert(is_ok(move));
|
||||||
|
|
||||||
givesCheck = FAST_GIVES_CHECK(pos, move, ci);
|
givesCheck = type_of(move) == NORMAL && !ci.dcCandidates
|
||||||
|
? ci.checkSq[type_of(pos.piece_on(from_sq(move)))] & to_sq(move)
|
||||||
|
: pos.gives_check(move, ci);
|
||||||
|
|
||||||
// Futility pruning
|
// Futility pruning
|
||||||
if ( !PvNode
|
if ( !PvNode
|
||||||
|
|||||||
Reference in New Issue
Block a user