From 74d5842810fd74a5dca7b087d7129faab941a18b Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Thu, 31 Jul 2014 20:44:46 -0500 Subject: Don't special-case reverse sort order This increases code size, and doesn't seem to help very significantly. --- grailsort.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/grailsort.c b/grailsort.c index 5edf40b..6e360dc 100644 --- a/grailsort.c +++ b/grailsort.c @@ -68,12 +68,6 @@ void grailsort(void *unsorted, size_t nmel, size_t width, cmpfun cmp) /* if already sorted, nothing to do */ if (cmp(TAIL(a, acount * blknmel, width), b) <= 0) return; - /* if blocks in b are all less than those in a, just need a rotate */ - if (cmp(TAIL(base, nmel, width), base) <= 0) { - rotate(base, nmel, width, acount * blknmel + bufnmel); - return; - } - /* sort all the a and b blocks together by their head elements */ grailsort(a, blocks, bwidth, cmp); -- cgit v1.2.3