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:
Marco Costalba
2009-06-20 08:31:39 +01:00
parent b1e79fed99
commit 3a4d6e2034
7 changed files with 30 additions and 26 deletions

View File

@@ -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)))