Remove an useless Max() in passed pawns evaluation
authorMarco Costalba <mcostalba@gmail.com>
Sat, 15 May 2010 23:56:05 +0000 (00:56 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 15 May 2010 23:56:05 +0000 (00:56 +0100)
There is no reason for that since tr cannot become negative.

Spotted by Ralph Stoesser.

No functional change.

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

index 479deb9fe084bcdb0b50184ac1ab43004bf374f2..fe28da3f0692ad0253d29f61eea4a70311eeffa7 100644 (file)
@@ -799,7 +799,7 @@ namespace {
         assert(pos.pawn_is_passed(Us, s));
 
         int r = int(relative_rank(Us, s) - RANK_2);
-        int tr = Max(0, r * (r - 1));
+        int tr = r * (r - 1);
 
         // Base bonus based on rank
         Value mbonus = Value(20 * tr);