]> git.sesse.net Git - stockfish/commitdiff
Retire one do_move() overload
authorMarco Costalba <mcostalba@gmail.com>
Sun, 15 Feb 2015 11:20:47 +0000 (12:20 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 15 Feb 2015 11:23:03 +0000 (12:23 +0100)
After Lucas patch it is almost useless.

No functional change.

src/position.cpp
src/position.h
src/search.cpp
src/uci.cpp

index efc71db89e015a4c8df6746fca181b4c9aa0a985..9db41b784918388f31b9f4d5a3385c043d2ae4f8 100644 (file)
@@ -684,12 +684,6 @@ bool Position::gives_check(Move m, const CheckInfo& ci) const {
 /// to a StateInfo object. The move is assumed to be legal. Pseudo-legal
 /// moves should be filtered out before this function is called.
 
 /// to a StateInfo object. The move is assumed to be legal. Pseudo-legal
 /// moves should be filtered out before this function is called.
 
-void Position::do_move(Move m, StateInfo& newSt) {
-
-  CheckInfo ci(*this);
-  do_move(m, newSt, gives_check(m, ci));
-}
-
 void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
 
   assert(is_ok(m));
 void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
 
   assert(is_ok(m));
@@ -848,7 +842,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
   // Update the key with the final value
   st->key = k;
 
   // Update the key with the final value
   st->key = k;
 
-  // Calculate checkers bitboard (if move is check)
+  // Calculate checkers bitboard (if move gives check)
   st->checkersBB = givesCheck ? attackers_to(king_square(them)) & pieces(us) : 0;
 
   sideToMove = ~sideToMove;
   st->checkersBB = givesCheck ? attackers_to(king_square(them)) & pieces(us) : 0;
 
   sideToMove = ~sideToMove;
index f8f61b55a981c2d5cdd4c93e6d4cbe1e4a8ef455..ece3f44232e9411222248dcc0fe4519aab09523a 100644 (file)
@@ -138,7 +138,6 @@ public:
   bool opposite_bishops() const;
 
   // Doing and undoing moves
   bool opposite_bishops() const;
 
   // Doing and undoing moves
-  void do_move(Move m, StateInfo& st);
   void do_move(Move m, StateInfo& st, bool givesCheck);
   void undo_move(Move m);
   void do_null_move(StateInfo& st);
   void do_move(Move m, StateInfo& st, bool givesCheck);
   void undo_move(Move m);
   void do_null_move(StateInfo& st);
index 3f9e29da0485763dbd40221008a1d977479d2794..9d7c1ef601e6514d09b161ac6683a697cc38c08e 100644 (file)
@@ -1474,7 +1474,7 @@ void RootMove::insert_pv_in_tt(Position& pos) {
       if (!ttHit || tte->move() != m) // Don't overwrite correct entries
           tte->save(pos.key(), VALUE_NONE, BOUND_NONE, DEPTH_NONE, m, VALUE_NONE, TT.generation());
 
       if (!ttHit || tte->move() != m) // Don't overwrite correct entries
           tte->save(pos.key(), VALUE_NONE, BOUND_NONE, DEPTH_NONE, m, VALUE_NONE, TT.generation());
 
-      pos.do_move(m, *st++);
+      pos.do_move(m, *st++, pos.gives_check(m, CheckInfo(pos)));
   }
 
   for (size_t i = pv.size(); i > 0; )
   }
 
   for (size_t i = pv.size(); i > 0; )
@@ -1494,7 +1494,7 @@ bool RootMove::extract_ponder_from_tt(Position& pos)
 
     assert(pv.size() == 1);
 
 
     assert(pv.size() == 1);
 
-    pos.do_move(pv[0], st);
+    pos.do_move(pv[0], st, pos.gives_check(pv[0], CheckInfo(pos)));
     TTEntry* tte = TT.probe(pos.key(), ttHit);
     pos.undo_move(pv[0]);
 
     TTEntry* tte = TT.probe(pos.key(), ttHit);
     pos.undo_move(pv[0]);
 
index ff3a64ece151aafe690695445066494cbee25d1d..b7127b758153c9fd008563f2f7412a5802ebdfad 100644 (file)
@@ -74,7 +74,7 @@ namespace {
     while (is >> token && (m = UCI::to_move(pos, token)) != MOVE_NONE)
     {
         SetupStates->push(StateInfo());
     while (is >> token && (m = UCI::to_move(pos, token)) != MOVE_NONE)
     {
         SetupStates->push(StateInfo());
-        pos.do_move(m, SetupStates->top());
+        pos.do_move(m, SetupStates->top(), pos.gives_check(m, CheckInfo(pos)));
     }
   }
 
     }
   }