mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Use piece_list to scan the pawns in evaluate_pawns()
No functional change and small speed increase. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
a806d7c3d6
commit
eddfd46a10
1 changed files with 3 additions and 4 deletions
|
@ -218,7 +218,7 @@ PawnInfoTable::Values PawnInfoTable::evaluate_pawns(const Position& pos, Bitboar
|
|||
int bonus;
|
||||
Value mgValue = Value(0);
|
||||
Value egValue = Value(0);
|
||||
Bitboard pawns = ourPawns;
|
||||
const Square* ptr = pos.piece_list_begin(Us, PAWN);
|
||||
|
||||
// Initialize pawn storm scores by giving bonuses for open files
|
||||
for (File f = FILE_A; f <= FILE_H; f++)
|
||||
|
@ -230,9 +230,8 @@ PawnInfoTable::Values PawnInfoTable::evaluate_pawns(const Position& pos, Bitboar
|
|||
}
|
||||
|
||||
// Loop through all pawns of the current color and score each pawn
|
||||
while (pawns)
|
||||
while ((s = *ptr++) != SQ_NONE)
|
||||
{
|
||||
s = pop_1st_bit(&pawns);
|
||||
f = square_file(s);
|
||||
r = square_rank(s);
|
||||
|
||||
|
@ -392,7 +391,7 @@ PawnInfoTable::Values PawnInfoTable::evaluate_pawns(const Position& pos, Bitboar
|
|||
mgValue += CandidateMidgameBonus[relative_rank(Us, s)];
|
||||
egValue += CandidateEndgameBonus[relative_rank(Us, s)];
|
||||
}
|
||||
} // while (pawns)
|
||||
}
|
||||
|
||||
return Values(mgValue, egValue);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue