]> git.sesse.net Git - stockfish/commitdiff
Simplify a condition in is_KXK()
authorMarco Costalba <mcostalba@gmail.com>
Thu, 19 Jun 2014 13:44:42 +0000 (15:44 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 19 Jun 2014 13:44:42 +0000 (15:44 +0200)
No functional change.

src/material.cpp

index 9a120661eb249306d1a52994a4485ea1b6bf60f9..0949a1bf418a899072865ad043d1048c39a1598b 100644 (file)
@@ -66,8 +66,7 @@ namespace {
   // Helper templates used to detect a given material distribution
   template<Color Us> bool is_KXK(const Position& pos) {
     const Color Them = (Us == WHITE ? BLACK : WHITE);
-    return  !pos.count<PAWN>(Them)
-          && pos.non_pawn_material(Them) == VALUE_ZERO
+    return  !more_than_one(pos.pieces(Them))
           && pos.non_pawn_material(Us) >= RookValueMg;
   }