]> git.sesse.net Git - stockfish/commitdiff
More readable score<CAPTURES>()
authorMarco Costalba <mcostalba@gmail.com>
Sat, 31 Jan 2015 19:13:38 +0000 (20:13 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 31 Jan 2015 19:13:38 +0000 (20:13 +0100)
No functional change.

src/movepick.cpp

index d6cd4e230d66e89c23fec925d5e680a439e2acef..44ce291214facb04d7d05c7ff232b68c88fb48cb 100644 (file)
@@ -148,11 +148,15 @@ void MovePicker::score<CAPTURES>() {
   // has been picked up in pick_move_from_list(). This way we save some SEE
   // calls in case we get a cutoff.
   for (auto& m : *this)
-      m.value =   PieceValue[MG][pos.piece_on(to_sq(m))]
-               -  Value(type_of(pos.moved_piece(m)))
-               + (type_of(m) == ENPASSANT ? PieceValue[MG][PAWN] :
-                  type_of(m) == PROMOTION ? PieceValue[MG][promotion_type(m)] - PieceValue[MG][PAWN]
-                                          : VALUE_ZERO);
+      if (type_of(m) == ENPASSANT)
+          m.value = PieceValue[MG][PAWN] - Value(PAWN);
+
+      else if (type_of(m) == PROMOTION)
+          m.value =  PieceValue[MG][pos.piece_on(to_sq(m))] - Value(PAWN)
+                   + PieceValue[MG][promotion_type(m)] - PieceValue[MG][PAWN];
+      else
+          m.value =  PieceValue[MG][pos.piece_on(to_sq(m))]
+                   - Value(type_of(pos.moved_piece(m)));
 }
 
 template<>