1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Retire one do_move() overload

After Lucas patch it is almost useless.

No functional change.
This commit is contained in:
Marco Costalba 2015-02-15 12:20:47 +01:00
parent dc13004283
commit 686b45e121
4 changed files with 4 additions and 11 deletions

View 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;

View 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);

View 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]);

View 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)));
}
}