From 56d1bef2497da5585d1c3ca4cc9238f8e813aa10 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Mon, 9 May 2016 10:45:48 +0200 Subject: [PATCH] Don't need to order pawns a second time --- src/syzygy/tbprobe.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/syzygy/tbprobe.cpp b/src/syzygy/tbprobe.cpp index 60b41080..5edbbcd2 100644 --- a/src/syzygy/tbprobe.cpp +++ b/src/syzygy/tbprobe.cpp @@ -696,13 +696,9 @@ uint64_t probe_table(const Position& pos, Entry* entry, WDLScore wdl = WDLDraw, for (int i = 0; i < size; ++i) squares[i] ^= 7; // Horizontal flip: SQ_H1 -> SQ_A1 - // Reorder the leading pawns according to Ptwist table, in descending order, - // and encode them. + // Encode leading pawns. Note that any previous horizontal flip preserves + // the order because MapToEdges[] is (almost) flip invariant. if (entry->hasPawns) { - - auto comp = [] (Square i, Square j) { return MapToEdges[i] > MapToEdges[j]; }; - std::sort(squares + 1, squares + leadPawnsCnt, comp); - idx = Pawnidx[leadPawnsCnt - 1][23 - MapToEdges[squares[0]] / 2]; for (int i = 1; i < leadPawnsCnt; ++i)