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 efc71db..9db41b7 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.
 
-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));
@@ -848,7 +842,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
   // 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;
index f8f61b5..ece3f44 100644 (file)
@@ -138,7 +138,6 @@ public:
   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);
index 3f9e29d..9d7c1ef 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());
 
-      pos.do_move(m, *st++);
+      pos.do_move(m, *st++, pos.gives_check(m, CheckInfo(pos)));
   }
 
   for (size_t i = pv.size(); i > 0; )
@@ -1494,7 +1494,7 @@ bool RootMove::extract_ponder_from_tt(Position& pos)
 
     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]);
 
index ff3a64e..b7127b7 100644 (file)
@@ -74,7 +74,7 @@ namespace {
     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)));
     }
   }