From ec9c2e7348c7e8bad890297f671126a23467be12 Mon Sep 17 00:00:00 2001 From: rektdie Date: Sun, 9 Mar 2025 05:03:31 +0100 Subject: [PATCH] init bestScore to staticScore in QS | bench 3786359 --- source/search.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 45d99cc..1545578 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -95,15 +95,12 @@ static SearchResults Quiescence(Board board, int alpha, int beta) { } int staticScore = Evaluate(board); - int bestScore = alpha; if (staticScore >= beta) { return staticScore; } - if (staticScore > bestScore) { - bestScore = staticScore; - } + int bestScore = staticScore; GenerateMoves(board, board.sideToMove); @@ -115,7 +112,7 @@ static SearchResults Quiescence(Board board, int alpha, int beta) { if (board.moveList[i].IsCapture()) { Board copy = board; copy.MakeMove(board.moveList[i]); - int score = -Quiescence(copy, -beta, -bestScore).score; + int score = -Quiescence(copy, -beta, -alpha).score; if (score >= beta) { return score;