1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Prefer out of loop variables in MovePicker::score_captures()

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2008-10-26 13:51:12 +01:00
parent 714069e248
commit fcc49561a1

View file

@ -210,16 +210,20 @@ void MovePicker::score_captures() {
// where it is possible to recapture with the hanging piece). Exchanging // where it is possible to recapture with the hanging piece). Exchanging
// big pieces before capturing a hanging piece probably helps to reduce // big pieces before capturing a hanging piece probably helps to reduce
// the subtree size. // the subtree size.
Move m;
int seeValue;
for (int i = 0; i < numOfMoves; i++) for (int i = 0; i < numOfMoves; i++)
{ {
int seeValue = pos.see(moves[i].move); m = moves[i].move;
seeValue = pos.see(m);
if (seeValue >= 0) if (seeValue >= 0)
{ {
if (move_promotion(moves[i].move)) if (move_promotion(m))
moves[i].score = QueenValueMidgame; moves[i].score = QueenValueMidgame;
else else
moves[i].score = int(pos.midgame_value_of_piece_on(move_to(moves[i].move))) moves[i].score = int(pos.midgame_value_of_piece_on(move_to(m)))
-int(pos.type_of_piece_on(move_from(moves[i].move))); -int(pos.type_of_piece_on(move_from(m)));
} else } else
moves[i].score = seeValue; moves[i].score = seeValue;
} }