From ee5aac2abc524fe8a8f43414b2f727b2b10f1ba4 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Fri, 13 May 2016 14:35:32 +0200 Subject: [PATCH] Always compute hasUniquePieces Now that is part of the common fields, it is natural always setthis memeber, even if for pawns is not used. --- src/syzygy/tbprobe.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/syzygy/tbprobe.cpp b/src/syzygy/tbprobe.cpp index 040ddc51..6aff948d 100644 --- a/src/syzygy/tbprobe.cpp +++ b/src/syzygy/tbprobe.cpp @@ -350,6 +350,11 @@ WDLEntry::WDLEntry(const Position& pos, Key keys[]) pieceCount = pos.count(WHITE) + pos.count(BLACK); 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) { // 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. @@ -359,11 +364,7 @@ WDLEntry::WDLEntry(const Position& pos, Key keys[]) pawn.pawnCount[0] = pos.count(c ? WHITE : BLACK); pawn.pawnCount[1] = pos.count(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()