Use a const pointer-to-member array for attacks

Allow the compiler to optimize member
function access.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2008-10-18 08:54:18 +02:00
parent aa7121297d
commit 3b857d1625
4 changed files with 10 additions and 15 deletions

View File

@@ -1004,9 +1004,10 @@ namespace {
int generate_piece_moves(PieceType piece, const Position &pos, MoveStack *mlist,
Color side, Bitboard target) {
const Piece_attacks_fn mem_fn = piece_attacks_fn[piece];
Square from, to;
Bitboard b;
Piece_attacks_fn mem_fn = piece_attacks_fn[piece];
int n = 0;
for (int i = 0; i < pos.piece_count(side, piece); i++)
@@ -1095,5 +1096,4 @@ namespace {
return n;
}
}