max_piece_type cleanup, and slight speed increase.
authormstembera <MissingEmail@email>
Tue, 28 Oct 2014 14:23:01 +0000 (22:23 +0800)
committerGary Linscott <glinscott@gmail.com>
Tue, 28 Oct 2014 14:23:01 +0000 (22:23 +0800)
No functional change.

Resolves #81

src/evaluate.cpp

index e4ade31..c915fbf 100644 (file)
@@ -499,12 +499,11 @@ namespace {
 
     assert(target & (pos.pieces(C) ^ pos.pieces(C, KING)));
 
-    PieceType pt;
-    for (pt = QUEEN; pt > PAWN; --pt)
+    for (PieceType pt = QUEEN; pt > PAWN; --pt)
         if (target & pos.pieces(C, pt))
             return pt;
 
-    return pt;
+    return PAWN;
   }