mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Prefer an assert to a comment in position.h
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
1cc42ac9e4
commit
fbbc7e421c
1 changed files with 4 additions and 2 deletions
|
@ -20,6 +20,8 @@
|
|||
#if !defined(POSITION_H_INCLUDED)
|
||||
#define POSITION_H_INCLUDED
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "bitboard.h"
|
||||
#include "move.h"
|
||||
#include "types.h"
|
||||
|
@ -525,13 +527,13 @@ inline bool Position::is_chess960() const {
|
|||
|
||||
inline bool Position::move_is_capture(Move m) const {
|
||||
|
||||
// Move must not be MOVE_NONE !
|
||||
assert (m != MOVE_NONE && m != MOVE_NULL);
|
||||
return (m & (3 << 15)) ? !move_is_castle(m) : !square_is_empty(move_to(m));
|
||||
}
|
||||
|
||||
inline bool Position::move_is_capture_or_promotion(Move m) const {
|
||||
|
||||
// Move must not be MOVE_NONE !
|
||||
assert (m != MOVE_NONE && m != MOVE_NULL);
|
||||
return (m & (0x1F << 12)) ? !move_is_castle(m) : !square_is_empty(move_to(m));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue