@@ -76,12 +76,12 @@ T2=$(TR $(TDNW $(LREF $1)) $(TD $+))
7676module std.algorithm.sorting ;
7777
7878import std.algorithm.mutation : SwapStrategy;
79- import std.functional ; // : unaryFun, binaryFun;
79+ import std.functional : unaryFun, binaryFun;
8080import std.range.primitives ;
81- import std.typecons : Flag;
81+ import std.typecons : Flag, Yes, No ;
8282// FIXME
83- import std.meta ; // : allSatisfy;
84- import std.range ; // : SortedRange;
83+ import std.meta : allSatisfy;
84+ import std.range : SortedRange;
8585import std.traits ;
8686
8787/**
@@ -747,7 +747,9 @@ if (isRandomAccessRange!Range && hasLength!Range && hasSlicing!Range)
747747 assert (a == [ 42 , 42 ]);
748748
749749 import std.algorithm.iteration : map;
750+ import std.array : array;
750751 import std.random ;
752+ import std.range : iota;
751753 import std.stdio ;
752754 auto s = unpredictableSeed;
753755 auto g = Random (s);
@@ -1059,6 +1061,7 @@ if (isRandomAccessRange!Range && !isInfinite!Range &&
10591061@safe unittest
10601062{
10611063 import std.algorithm.comparison : equal;
1064+ import std.range : iota;
10621065
10631066 ubyte [256 ] index = void ;
10641067 iota(256 ).makeIndex(index[]);
@@ -1537,7 +1540,8 @@ private void multiSortImpl(Range, SwapStrategy ss, funs...)(Range r)
15371540@safe unittest
15381541{
15391542 import std.algorithm.comparison : equal;
1540- import std.range ;
1543+ import std.array : array;
1544+ import std.range : indexed, iota, retro;
15411545
15421546 static struct Point { int x, y; }
15431547 auto pts1 = [ Point(5 , 6 ), Point(1 , 0 ), Point(5 , 7 ), Point(1 , 1 ), Point(1 , 2 ), Point(0 , 1 ) ];
@@ -1784,6 +1788,7 @@ private void sort5(alias lt, Range)(Range r)
17841788{
17851789 import std.algorithm.iteration : permutations;
17861790 import std.algorithm.mutation : copy;
1791+ import std.range : iota;
17871792
17881793 int [5 ] buf;
17891794 foreach (per; iota(5 ).permutations)
@@ -1925,6 +1930,9 @@ if (((ss == SwapStrategy.unstable && (hasSwappableElements!Range ||
19251930{
19261931 // Simple regression benchmark
19271932 import std.algorithm.iteration , std.algorithm.mutation , std.random ;
1933+ import std.array : array;
1934+ import std.range : iota;
1935+
19281936 Random rng;
19291937 int [] a = iota(20148 ).map! (_ => uniform(- 1000 , 1000 , rng)).array;
19301938 static uint comps;
@@ -3436,6 +3444,8 @@ done:
34363444
34373445@safe unittest
34383446{
3447+ import std.array : array;
3448+
34393449 auto a = [ 10 , 5 , 3 , 4 , 8 , 11 , 13 , 3 , 9 , 4 , 10 ];
34403450 assert (expandPartition! ((a, b) => a < b)(a, 4 , 5 , 6 ) == 9 );
34413451 a = randomArray;
@@ -3450,7 +3460,10 @@ private T[] randomArray(Flag!"exactSize" flag = No.exactSize, T = int)(
34503460 T minValue = 0 , T maxValue = 255 )
34513461{
34523462 import std.algorithm.iteration : map;
3463+ import std.array : array;
34533464 import std.random : unpredictableSeed, Random , uniform;
3465+ import std.range : iota;
3466+
34543467 auto size = flag == Yes.exactSize ? maxSize : uniform(1 , maxSize);
34553468 return iota (0 , size).map! (_ => uniform(minValue, maxValue)).array;
34563469}
0 commit comments