]> git.sesse.net Git - stockfish/blobdiff - src/movepick.cpp
Sort moves partially: linear depth dependence
[stockfish] / src / movepick.cpp
index 8a4a8b8f75642b7997f4574b6485f8877a54d721..cc79528027b25334be0316e2499137cd29c3c3e6 100644 (file)
@@ -37,7 +37,7 @@ namespace {
   // An insertion sort, which sorts moves in descending order up to and including a given limit.
   // The order of moves smaller than the limit is left unspecified.
   // To keep the implementation simple, *begin is always included in the list of sorted moves.
-  void partial_insertion_sort(ExtMove* begin, ExtMove* end, Value limit)
+  void partial_insertion_sort(ExtMove* begin, ExtMove* end, int limit)
   {
     for (ExtMove *sortedEnd = begin + 1, *p = begin + 1; p < end; ++p)
         if (p->value >= limit)
@@ -242,8 +242,7 @@ Move MovePicker::next_move(bool skipQuiets) {
       endMoves = generate<QUIETS>(pos, cur);
       score<QUIETS>();
 
-      partial_insertion_sort(cur, endMoves,
-                             depth < 3 * ONE_PLY ? VALUE_ZERO : Value(INT_MIN));
+      partial_insertion_sort(cur, endMoves, -4000 * depth / ONE_PLY);
       ++stage;
 
   case QUIET: