]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
max_piece_type cleanup, and slight speed increase.
[stockfish] / src / evaluate.cpp
index ad420fbdae4917ba01070f5f2b7ae98991e263ed..c915fbfaaad9b022fd700b36841894bd5179dcb2 100644 (file)
@@ -27,7 +27,7 @@
 #include "material.h"
 #include "pawns.h"
 #include "thread.h"
-#include "ucioption.h"
+#include "uci.h"
 
 namespace {
 
@@ -499,9 +499,11 @@ namespace {
 
     assert(target & (pos.pieces(C) ^ pos.pieces(C, KING)));
 
-    PieceType pt;
-    for (pt = QUEEN; !(target & pos.pieces(C, pt)); --pt) {}
-    return pt;
+    for (PieceType pt = QUEEN; pt > PAWN; --pt)
+        if (target & pos.pieces(C, pt))
+            return pt;
+
+    return PAWN;
   }