mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Always compute hasUniquePieces
Now that is part of the common fields, it is natural always setthis memeber, even if for pawns is not used.
This commit is contained in:
parent
018d907d74
commit
ee5aac2abc
1 changed files with 6 additions and 5 deletions
|
@ -350,6 +350,11 @@ WDLEntry::WDLEntry(const Position& pos, Key keys[])
|
||||||
pieceCount = pos.count<ALL_PIECES>(WHITE) + pos.count<ALL_PIECES>(BLACK);
|
pieceCount = pos.count<ALL_PIECES>(WHITE) + pos.count<ALL_PIECES>(BLACK);
|
||||||
hasPawns = pos.pieces(PAWN);
|
hasPawns = pos.pieces(PAWN);
|
||||||
|
|
||||||
|
for (Color c = WHITE; c <= BLACK; ++c)
|
||||||
|
for (PieceType pt = PAWN; pt < KING; ++pt)
|
||||||
|
if (popcount(pos.pieces(c, pt)) == 1)
|
||||||
|
hasUniquePieces = true;
|
||||||
|
|
||||||
if (hasPawns) {
|
if (hasPawns) {
|
||||||
// Set the leading color. In case both sides have pawns the leading color
|
// Set the leading color. In case both sides have pawns the leading color
|
||||||
// is the side with less pawns because this leads to a better compression.
|
// is the side with less pawns because this leads to a better compression.
|
||||||
|
@ -359,11 +364,7 @@ WDLEntry::WDLEntry(const Position& pos, Key keys[])
|
||||||
|
|
||||||
pawn.pawnCount[0] = pos.count<PAWN>(c ? WHITE : BLACK);
|
pawn.pawnCount[0] = pos.count<PAWN>(c ? WHITE : BLACK);
|
||||||
pawn.pawnCount[1] = pos.count<PAWN>(c ? BLACK : WHITE);
|
pawn.pawnCount[1] = pos.count<PAWN>(c ? BLACK : WHITE);
|
||||||
} else
|
}
|
||||||
for (Color c = WHITE; c <= BLACK; ++c)
|
|
||||||
for (PieceType pt = PAWN; pt < KING; ++pt)
|
|
||||||
if (popcount(pos.pieces(c, pt)) == 1)
|
|
||||||
hasUniquePieces = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WDLEntry::~WDLEntry()
|
WDLEntry::~WDLEntry()
|
||||||
|
|
Loading…
Add table
Reference in a new issue