mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Micro optimize Position::move_is_check()
More then optimization it is worth a bit of better code self documenting. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -74,6 +74,13 @@ inline SignedDirection signed_direction_between_squares(Square s1, Square s2) {
|
||||
return SignedDirection(SignedDirectionTable[s1][s2]);
|
||||
}
|
||||
|
||||
inline bool direction_is_diagonal(Square s1, Square s2) {
|
||||
return DirectionTable[s1][s2] & 2;
|
||||
}
|
||||
|
||||
inline bool direction_is_straight(Square s1, Square s2) {
|
||||
return DirectionTable[s1][s2] < 2;
|
||||
}
|
||||
|
||||
////
|
||||
//// Prototypes
|
||||
|
||||
Reference in New Issue
Block a user