]> git.sesse.net Git - stockfish/commitdiff
Simplify code, delete else after return
authorMiroslav Fontán <miroslav.fontan>
Thu, 3 Nov 2016 11:04:24 +0000 (12:04 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 5 Nov 2016 07:08:25 +0000 (08:08 +0100)
src/endgame.cpp

index 618113904afe096c87ee3c56378b7fd0ac330628..38c322afc7dbb1a2214c711b1f7cd6a6f56fe569 100644 (file)
@@ -652,17 +652,15 @@ ScaleFactor Endgame<KBPKB>::operator()(const Position& pos) const {
 
       if (relative_rank(strongSide, pawnSq) <= RANK_5)
           return SCALE_FACTOR_DRAW;
-      else
-      {
-          Bitboard path = forward_bb(strongSide, pawnSq);
+      
+      Bitboard path = forward_bb(strongSide, pawnSq);
 
-          if (path & pos.pieces(weakSide, KING))
-              return SCALE_FACTOR_DRAW;
+      if (path & pos.pieces(weakSide, KING))
+          return SCALE_FACTOR_DRAW;
 
-          if (  (pos.attacks_from<BISHOP>(weakBishopSq) & path)
-              && distance(weakBishopSq, pawnSq) >= 3)
-              return SCALE_FACTOR_DRAW;
-      }
+      if (  (pos.attacks_from<BISHOP>(weakBishopSq) & path)
+          && distance(weakBishopSq, pawnSq) >= 3)
+          return SCALE_FACTOR_DRAW;
   }
   return SCALE_FACTOR_NONE;
 }