Make a version of Position::do_move() without the givesCheck parameter

In 10 of 12 calls total to Position::do_move()the givesCheck argument is
simply gives_check(m). So it's reasonable to make an overload without
this parameter, which wraps the existing version.

No functional change.
This commit is contained in:
Aram Tumanian
2016-11-11 15:02:28 +02:00
committed by Marco Costalba
parent de269ee18e
commit e6c2899020
4 changed files with 15 additions and 10 deletions

View File

@@ -128,6 +128,7 @@ public:
bool opposite_bishops() const;
// Doing and undoing moves
void do_move(Move m, StateInfo& newSt);
void do_move(Move m, StateInfo& newSt, bool givesCheck);
void undo_move(Move m);
void do_null_move(StateInfo& newSt);
@@ -412,4 +413,8 @@ inline void Position::move_piece(Piece pc, Square from, Square to) {
pieceList[pc][index[to]] = to;
}
inline void Position::do_move(Move m, StateInfo& newSt) {
do_move(m, newSt, gives_check(m));
}
#endif // #ifndef POSITION_H_INCLUDED