Prefer template to name decoration

This also allows faster code although bigger.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2008-10-19 12:43:09 +01:00
parent 832a8a2719
commit f036239521
5 changed files with 111 additions and 111 deletions
+2 -2
View File
@@ -489,7 +489,7 @@ ScaleFactor KQKRPScalingFunction::apply(const Position &pos) {
relative_rank(weakerSide, pos.king_square(strongerSide)) >= RANK_4 &&
(pos.rooks(weakerSide) & relative_rank_bb(weakerSide, RANK_3)) &&
(pos.pawns(weakerSide) & relative_rank_bb(weakerSide, RANK_2)) &&
(pos.king_attacks(kingSq) & pos.pawns(weakerSide))) {
(pos.piece_attacks<KING>(kingSq) & pos.pawns(weakerSide))) {
Square rsq = pos.rook_list(weakerSide, 0);
if(pos.pawn_attacks(strongerSide, rsq) & pos.pawns(weakerSide))
return ScaleFactor(0);
@@ -732,7 +732,7 @@ ScaleFactor KBPKBScalingFunction::apply(const Position &pos) {
ray_bb(pawnSq, (strongerSide == WHITE)? SIGNED_DIR_N : SIGNED_DIR_S);
if(ray & pos.kings(weakerSide))
return ScaleFactor(0);
if((pos.bishop_attacks(weakerBishopSq) & ray)
if((pos.piece_attacks<BISHOP>(weakerBishopSq) & ray)
&& square_distance(weakerBishopSq, pawnSq) >= 3)
return ScaleFactor(0);
}