From adf29b3fd69cdca035d1aa6675e01acafbf4d07f Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Fri, 25 Aug 2023 15:42:44 +0300 Subject: [PATCH] Rename one variable To enhance code clarity and prevent potential confusion with the 'r' variable assigned to reduction later in the code, this pull request renames it to 'reductionScale' when we use the same name in the reduction() function. Using distinct variable names for separate functions improves code readability and maintainability. closes https://github.com/official-stockfish/Stockfish/pull/4765 No functional change --- src/search.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 76d0545a..eefe5a3b 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -80,8 +80,9 @@ namespace { int Reductions[MAX_MOVES]; // [depth or moveNumber] Depth reduction(bool i, Depth d, int mn, Value delta, Value rootDelta) { - int r = Reductions[d] * Reductions[mn]; - return (r + 1372 - int(delta) * 1073 / int(rootDelta)) / 1024 + (!i && r > 936); + int reductionScale = Reductions[d] * Reductions[mn]; + return (reductionScale + 1372 - int(delta) * 1073 / int(rootDelta)) / 1024 + + (!i && reductionScale > 936); } constexpr int futility_move_count(bool improving, Depth depth) { -- 2.39.2