Small simplification in scale_by_game_phase()
authorMarco Costalba <mcostalba@gmail.com>
Sun, 17 Apr 2011 09:31:26 +0000 (10:31 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 17 Apr 2011 09:31:26 +0000 (10:31 +0100)
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/evaluate.cpp

index 86b37e3b045a63ae92ebe1b962d132f770b55555..5586d64d0315ac1c68acd70103a5bd1bd44b823b 100644 (file)
@@ -1156,9 +1156,7 @@ namespace {
     assert(eg_value(v) > -VALUE_INFINITE && eg_value(v) < VALUE_INFINITE);
     assert(ph >= PHASE_ENDGAME && ph <= PHASE_MIDGAME);
 
-    Value eg = eg_value(v);
-    Value ev = Value((eg * int(sf)) / SCALE_FACTOR_NORMAL);
-
+    int ev = (eg_value(v) * int(sf)) / SCALE_FACTOR_NORMAL;
     int result = (mg_value(v) * int(ph) + ev * int(128 - ph)) / 128;
     return Value((result + GrainSize / 2) & ~(GrainSize - 1));
   }