mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 18:46:59 +08:00
Minor cleanup of search.cpp
Four very minor edits. Note that tte->save() uses posKey and not pos.key() in other places. Originally I also added a futility_move_counts() function to make things more consistent with the futility_margin() and reduction() functions. But then razor_margin[] should probably also be turned into a function, etc. Maybe a good idea, maybe not. So I did not include it. Non functional change.
This commit is contained in:
@@ -812,7 +812,7 @@ moves_loop: // When in check search starts from here
|
||||
movedPiece = pos.moved_piece(move);
|
||||
|
||||
givesCheck = type_of(move) == NORMAL && !pos.discovered_check_candidates()
|
||||
? pos.check_squares(type_of(pos.piece_on(from_sq(move)))) & to_sq(move)
|
||||
? pos.check_squares(type_of(movedPiece)) & to_sq(move)
|
||||
: pos.gives_check(move);
|
||||
|
||||
moveCountPruning = depth < 16 * ONE_PLY
|
||||
@@ -1196,7 +1196,7 @@ moves_loop: // When in check search starts from here
|
||||
if (bestValue >= beta)
|
||||
{
|
||||
if (!ttHit)
|
||||
tte->save(pos.key(), value_to_tt(bestValue, ss->ply), BOUND_LOWER,
|
||||
tte->save(posKey, value_to_tt(bestValue, ss->ply), BOUND_LOWER,
|
||||
DEPTH_NONE, MOVE_NONE, ss->staticEval, TT.generation());
|
||||
|
||||
return bestValue;
|
||||
@@ -1220,7 +1220,7 @@ moves_loop: // When in check search starts from here
|
||||
assert(is_ok(move));
|
||||
|
||||
givesCheck = type_of(move) == NORMAL && !pos.discovered_check_candidates()
|
||||
? pos.check_squares(type_of(pos.piece_on(from_sq(move)))) & to_sq(move)
|
||||
? pos.check_squares(type_of(pos.moved_piece(move))) & to_sq(move)
|
||||
: pos.gives_check(move);
|
||||
|
||||
moveCount++;
|
||||
|
||||
Reference in New Issue
Block a user