X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmove.h;h=71def812d85743708d1a6ed22622aba696c2f6d0;hp=9702d9fbebcfbd0ab6a9088b3889f4807eb754c2;hb=b0858877aeb0fc077526b04ef11a811b5b5b9e12;hpb=321f6d1d1979d55862ad907fb3fa761b9c35872c diff --git a/src/move.h b/src/move.h index 9702d9fb..71def812 100644 --- a/src/move.h +++ b/src/move.h @@ -86,8 +86,8 @@ inline void insertion_sort(T* firstMove, T* lastMove) } } -// Our dedicated sort in range [firstMove, lastMove), it is well -// tuned for non-captures where we have a lot of zero scored moves. +// Our dedicated sort in range [firstMove, lastMove), first splits +// positive scores from ramining then order seaprately the two sets. template inline void sort_moves(T* firstMove, T* lastMove) { @@ -114,28 +114,8 @@ inline void sort_moves(T* firstMove, T* lastMove) } while (p != d); - // Sort positives + // Sort positives and non-positives separately insertion_sort(firstMove, p); - - d = lastMove; - p--; - - // Split zero vs negatives - do { - while ((++p)->score == 0); - - if (p != d) - { - while (--d != p && d->score < 0); - - tmp = *p; - *p = *d; - *d = tmp; - } - - } while (p != d); - - // Sort negatives insertion_sort(p, lastMove); }