Simplify attacks_bb()

And some formatting while there.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-05-01 12:17:08 +01:00
parent b9bc6e823f
commit 2f47844c7c
2 changed files with 12 additions and 17 deletions

View File

@@ -216,8 +216,7 @@ FORCE_INLINE unsigned magic_index(Square s, Bitboard occ) {
template<PieceType Pt>
inline Bitboard attacks_bb(Square s, Bitboard occ) {
Bitboard** const Attacks = Pt == ROOK ? RAttacks : BAttacks;
return Attacks[s][magic_index<Pt>(s, occ)];
return (Pt == ROOK ? RAttacks : BAttacks)[s][magic_index<Pt>(s, occ)];
}