From 32e98de308c0bf635b4f27048101be9ce599f8f1 Mon Sep 17 00:00:00 2001 From: Richard Thier Date: Thu, 11 Apr 2024 17:19:10 +0200 Subject: [PATCH] Revert "mormord sort further optimizations (for me slower - btw it might need to be called mormord-prenex-magyarsort at this point? I added a lot to it tbh like copied parts of thiersort for this to work)" This reverts commit bccb1d070333a2d67eeba548bf8dca1db9b67fa5. --- ypsu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ypsu.cpp b/ypsu.cpp index d80a207..8a72d70 100644 --- a/ypsu.cpp +++ b/ypsu.cpp @@ -196,17 +196,17 @@ static inline void mormord_sort_impl(uint32_t *a, int n, int j) noexcept { uint32_t pivoti = 0; while(pivoti < n) { uint32_t radixval = morgrab(a[pivoti], j); - uint32_t targeti = --radics[radixval]; // already dec index for swap + uint32_t targeti = radics[radixval] - 1; if(targeti > pivoti) { // swap uint32_t tmp = a[pivoti]; a[pivoti] = a[targeti]; a[targeti] = tmp; + // dec index + --radics[radixval]; } else { // progress pivot ++pivoti; - // "undec" index - ++radics[radixval]; } }