From bf90499fc33a4e2e5af694b11e9a8f145bf82d2c Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 13 Jul 2013 13:27:22 +0200 Subject: [PATCH 1/1] =?utf8?q?A=20useless=20assignment=20found=20by=20Clan?= =?utf8?q?g=E2=80=99s=20static=20analyzer?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Warning is: "Value stored to 'xxx' is never read" and it is raised in SpNode case. No functional change. --- src/search.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 5ea1f561..be9f108a 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -502,7 +502,6 @@ namespace { // Step 1. Initialize node Thread* thisThread = pos.this_thread(); - moveCount = quietCount = 0; inCheck = pos.checkers(); if (SpNode) @@ -520,6 +519,7 @@ namespace { goto moves_loop; } + moveCount = quietCount = 0; bestValue = -VALUE_INFINITE; ss->currentMove = threatMove = (ss+1)->excludedMove = bestMove = MOVE_NONE; ss->ply = (ss-1)->ply + 1; @@ -1243,8 +1243,7 @@ moves_loop: // When in check and at SpNode search starts from here } // Detect non-capture evasions that are candidate to be pruned - evasionPrunable = !PvNode - && InCheck + evasionPrunable = InCheck && bestValue > VALUE_MATED_IN_MAX_PLY && !pos.is_capture(move) && !pos.can_castle(pos.side_to_move()); -- 2.39.2