mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
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:
committed by
Marco Costalba
parent
de269ee18e
commit
e6c2899020
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user