Simplify FutilityMoveCount

Inlined condition, instead of a function.

closes https://github.com/official-stockfish/Stockfish/pull/6096

no functional change
This commit is contained in:
Daniel Samek
2025-05-25 20:19:28 +02:00
committed by Joost VandeVondele
parent eb27d9420f
commit 805a2c1672

View File

@@ -69,10 +69,6 @@ namespace {
// so changing them or adding conditions that are similar requires
// tests at these types of time controls.
constexpr int futility_move_count(bool improving, Depth depth) {
return (3 + depth * depth) / (2 - improving);
}
int correction_value(const Worker& w, const Position& pos, const Stack* const ss) {
const Color us = pos.side_to_move();
const auto m = (ss - 1)->currentMove;
@@ -1047,7 +1043,7 @@ moves_loop: // When in check, search starts here
if (!rootNode && pos.non_pawn_material(us) && !is_loss(bestValue))
{
// Skip quiet moves if movecount exceeds our FutilityMoveCount threshold
if (moveCount >= futility_move_count(improving, depth))
if (moveCount >= (3 + depth * depth) / (2 - improving))
mp.skip_quiet_moves();
// Reduced depth of the next LMR search