|
344 | 344 | foreach(array; data[1..$]) { |
345 | 345 | assert(array.length == len); |
346 | 346 | } |
347 | | -} body { |
| 347 | +} do { |
348 | 348 | if(data[0].length < 25) { |
349 | 349 | // Skip computing logarithm rather than waiting until qsortImpl to |
350 | 350 | // do this. |
|
481 | 481 | static if(!is(typeof(array) == ulong*)) |
482 | 482 | assert(array.length == len); |
483 | 483 | } |
484 | | -} body { |
| 484 | +} do { |
485 | 485 | if(data[0].length < 65) { //Avoid mem allocation. |
486 | 486 | return insertionSortImpl!(compFun)(data); |
487 | 487 | } |
|
602 | 602 | static if(!is(typeof(array) == ulong*)) |
603 | 603 | assert(array.length == len); |
604 | 604 | } |
605 | | -} body { |
| 605 | +} do { |
606 | 606 | static if(is(T[$ - 1] == ulong*)) { |
607 | 607 | enum dl = data.length - 1; |
608 | 608 | } else { |
|
737 | 737 | foreach(array; data[1..$]) { |
738 | 738 | assert(array.length == len); |
739 | 739 | } |
740 | | -} body { |
| 740 | +} do { |
741 | 741 | auto toSort = prepareForSorting!compFun(data[0]); |
742 | 742 | mergeSortInPlaceImpl!compFun(toSort, data[1..$]); |
743 | 743 | postProcess!compFun(data[0]); |
|
854 | 854 | foreach(array; data[1..$]) { |
855 | 855 | assert(array.length == len); |
856 | 856 | } |
857 | | -} body { |
| 857 | +} do { |
858 | 858 | auto toSort = prepareForSorting!compFun(data[0]); |
859 | 859 | heapSortImpl!compFun(toSort, data[1..$]); |
860 | 860 | postProcess!compFun(data[0]); |
|
944 | 944 | static if(!is(typeof(array) == ulong*)) |
945 | 945 | assert(array.length == len); |
946 | 946 | } |
947 | | -} body { |
| 947 | +} do { |
948 | 948 | auto toSort = prepareForSorting!compFun(data[0]); |
949 | 949 | insertionSortImpl!compFun(toSort, data[1..$]); |
950 | 950 | postProcess!compFun(data[0]); |
@@ -1111,7 +1111,7 @@ in { |
1111 | 1111 | foreach(array; data[1..$]) { |
1112 | 1112 | assert(array.length == len); |
1113 | 1113 | } |
1114 | | -} body { |
| 1114 | +} do { |
1115 | 1115 | // Don't use the float-to-int trick because it's actually slower here |
1116 | 1116 | // because the main part of the algorithm is O(N), not O(N log N). |
1117 | 1117 | return partitionKImpl!compFun(data, k); |
@@ -1293,4 +1293,3 @@ unittest { |
1293 | 1293 | assert(more.getSorted == qsort!("a > b")(nums[0..5])); |
1294 | 1294 | } |
1295 | 1295 | } |
1296 | | - |
0 commit comments