]> git.sesse.net Git - stockfish/blobdiff - src/syzygy/tbprobe.cpp
Sequencing tweak in tbprobe()
[stockfish] / src / syzygy / tbprobe.cpp
index a9378b4ba0914ef72a387743f4f53c4063d33b81..c04534921eaaf42c8da8f75b3a02240e2c165287 100644 (file)
@@ -730,8 +730,8 @@ Ret do_probe_table(const Position& pos, T* entry, WDLScore wdl, ProbeState* resu
 
     // Then we reorder the pieces to have the same sequence as the one stored
     // in pieces[i]: the sequence that ensures the best compression.
-    for (int i = leadPawnsCnt; i < size; ++i)
-        for (int j = i; j < size; ++j)
+    for (int i = leadPawnsCnt; i < size - 1; ++i)
+        for (int j = i + 1; j < size; ++j)
             if (d->pieces[i] == pieces[j])
             {
                 std::swap(pieces[i], pieces[j]);