mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 16:46:30 +08:00
Micro optimize and rename move_promotion()
Rename to move_is_promotion() to be more clear, also add a new function move_promotion_piece() to get the promotion piece type in the few places where is needed. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -247,7 +247,7 @@ void MovePicker::score_captures() {
|
||||
seeValue = pos.see(m);
|
||||
if (seeValue >= 0)
|
||||
{
|
||||
if (move_promotion(m))
|
||||
if (move_is_promotion(m))
|
||||
moves[i].score = QueenValueMidgame;
|
||||
else
|
||||
moves[i].score = int(pos.midgame_value_of_piece_on(move_to(m)))
|
||||
@@ -307,7 +307,7 @@ void MovePicker::score_qcaptures() {
|
||||
for (int i = 0; i < numOfMoves; i++)
|
||||
{
|
||||
Move m = moves[i].move;
|
||||
if (move_promotion(m))
|
||||
if (move_is_promotion(m))
|
||||
moves[i].score = QueenValueMidgame;
|
||||
else
|
||||
moves[i].score = int(pos.midgame_value_of_piece_on(move_to(m)))
|
||||
|
||||
Reference in New Issue
Block a user