- if (depth < 3 * ONE_PLY)
- {
- ExtMove* goodQuiet = std::partition(cur, endMoves, [](const ExtMove& m)
- { return m.value > VALUE_ZERO; });
- insertion_sort(cur, goodQuiet);
- } else
- insertion_sort(cur, endMoves);
+
+ partial_insertion_sort(cur, endMoves,
+ depth < 3 * ONE_PLY ? 0 : INT_MIN);