]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
First check threshold in space evaluation
[stockfish] / src / evaluate.cpp
index c54b6d30bc81eed71e2582bfa7704cfc1da34739..9eebad9e5b3f434ffe9dec8d5971be8c96db699d 100644 (file)
@@ -718,14 +718,14 @@ namespace {
   template<Tracing T> template<Color Us>
   Score Evaluation<T>::space() const {
 
+    if (pos.non_pawn_material() < SpaceThreshold)
+        return SCORE_ZERO;
+
     constexpr Color Them = (Us == WHITE ? BLACK : WHITE);
     constexpr Bitboard SpaceMask =
       Us == WHITE ? CenterFiles & (Rank2BB | Rank3BB | Rank4BB)
                   : CenterFiles & (Rank7BB | Rank6BB | Rank5BB);
 
-    if (pos.non_pawn_material() < SpaceThreshold)
-        return SCORE_ZERO;
-
     // Find the available squares for our pieces inside the area defined by SpaceMask
     Bitboard safe =   SpaceMask
                    & ~pos.pieces(Us, PAWN)