mirror of
https://github.com/sockspls/badfish
synced 2025-07-12 03:59:15 +00:00
Remove redundant condition from capture_stage()
Change a non functional promotion check to an assert. closes https://github.com/official-stockfish/Stockfish/pull/4436 No functional change
This commit is contained in:
parent
d1e17989b5
commit
7077fbdd14
2 changed files with 2 additions and 3 deletions
|
@ -569,8 +569,7 @@ bool Position::pseudo_legal(const Move m) const {
|
||||||
: MoveList<NON_EVASIONS>(*this).contains(m);
|
: MoveList<NON_EVASIONS>(*this).contains(m);
|
||||||
|
|
||||||
// Is not a promotion, so promotion piece must be empty
|
// Is not a promotion, so promotion piece must be empty
|
||||||
if (promotion_type(m) - KNIGHT != NO_PIECE_TYPE)
|
assert(promotion_type(m) - KNIGHT == NO_PIECE_TYPE);
|
||||||
return false;
|
|
||||||
|
|
||||||
// If the 'from' square is not occupied by a piece belonging to the side to
|
// If the 'from' square is not occupied by a piece belonging to the side to
|
||||||
// move, the move is obviously not legal.
|
// move, the move is obviously not legal.
|
||||||
|
|
|
@ -393,7 +393,7 @@ inline bool Position::capture(Move m) const {
|
||||||
// is needed to avoid the generation of duplicate moves.
|
// is needed to avoid the generation of duplicate moves.
|
||||||
inline bool Position::capture_stage(Move m) const {
|
inline bool Position::capture_stage(Move m) const {
|
||||||
assert(is_ok(m));
|
assert(is_ok(m));
|
||||||
return capture(m) || (type_of(m) == PROMOTION && promotion_type(m) == QUEEN);
|
return capture(m) || promotion_type(m) == QUEEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Piece Position::captured_piece() const {
|
inline Piece Position::captured_piece() const {
|
||||||
|
|
Loading…
Add table
Reference in a new issue