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:
Marco Costalba
2009-04-27 17:39:59 +02:00
parent b35e593551
commit ab69f50c64
2 changed files with 11 additions and 6 deletions

View File

@@ -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