From 805a2c1672e080106bc9eee00cc7195732c50fa1 Mon Sep 17 00:00:00 2001 From: Daniel Samek Date: Sun, 25 May 2025 20:19:28 +0200 Subject: [PATCH] Simplify FutilityMoveCount Inlined condition, instead of a function. closes https://github.com/official-stockfish/Stockfish/pull/6096 no functional change --- src/search.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 8c31fb3a7..d7abef3d2 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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