Skip to content

Commit 67d44e4

Browse files
committed
Remove package wide std.algorithm imports from Phobos
1 parent 66f3456 commit 67d44e4

File tree

20 files changed

+43
-37
lines changed

20 files changed

+43
-37
lines changed

std/algorithm/comparison.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ template equal(alias pred = "a == b")
789789
@safe unittest
790790
{
791791
import std.math : approxEqual;
792-
import std.algorithm : equal;
792+
import std.algorithm.comparison : equal;
793793

794794
int[] a = [ 1, 2, 4, 3 ];
795795
assert(!equal(a, a[1..$]));
@@ -815,7 +815,7 @@ range of range (of range...) comparisons.
815815
@safe unittest
816816
{
817817
import std.range : iota, chunks;
818-
import std.algorithm : equal;
818+
import std.algorithm.comparison : equal;
819819
assert(equal!(equal!equal)(
820820
[[[0, 1], [2, 3]], [[4, 5], [6, 7]]],
821821
iota(0, 8).chunks(2).chunks(2)

std/algorithm/iteration.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3328,7 +3328,8 @@ The number of seeds must be correspondingly increased.
33283328
*/
33293329
@safe unittest
33303330
{
3331-
import std.algorithm : map, max, min;
3331+
import std.algorithm.comparison : max, min;
3332+
import std.algorithm.iteration : map;
33323333
import std.math : approxEqual;
33333334
import std.typecons : tuple;
33343335

@@ -3347,7 +3348,7 @@ The number of seeds must be correspondingly increased.
33473348

33483349
@safe unittest
33493350
{
3350-
import std.algorithm : equal, map, max, min;
3351+
import std.algorithm.comparison : equal, max, min;
33513352
import std.conv : to;
33523353
import std.range : chain;
33533354
import std.typecons : tuple;
@@ -3406,7 +3407,6 @@ The number of seeds must be correspondingly increased.
34063407

34073408
@safe unittest
34083409
{
3409-
import std.algorithm : map;
34103410
import std.math : approxEqual;
34113411
import std.typecons : tuple;
34123412

std/algorithm/setops.d

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ auto cartesianProduct(R1, R2)(R1 range1, R2 range2)
339339
// Issue 13091
340340
pure nothrow @safe @nogc unittest
341341
{
342-
import std.algorithm : cartesianProduct;
343342
int[1] a = [1];
344343
foreach (t; cartesianProduct(a[], a[])) {}
345344
}

std/base64.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,8 @@ class Base64Exception : Exception
17371737

17381738
@system unittest
17391739
{
1740-
import std.algorithm : sort, equal;
1740+
import std.algorithm.sorting : sort;
1741+
import std.algorithm.comparison : equal;
17411742
import std.conv;
17421743
import std.file;
17431744
import std.stdio;

std/container/package.d

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ as the one being worked with. It is important to note that many generic range
148148
algorithms return the same range type as their input range.
149149
150150
---
151-
import std.algorithm : equal, find;
151+
import std.algorithm.comparison : equal;
152+
import std.algorithm.iteration : find;
152153
import std.container;
153154
import std.range : take;
154155
@@ -173,7 +174,7 @@ a member function, the documention usually refers to the parameter's templated
173174
type as $(D Stuff).
174175
175176
---
176-
import std.algorithm : equal;
177+
import std.algorithm.comparison : equal;
177178
import std.container;
178179
import std.range : iota;
179180

std/csv.d

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ auto csvReader(Contents = string,
755755

756756
@safe unittest // const/immutable dchars
757757
{
758-
import std.algorithm : map;
758+
import std.algorithm.iteration : map;
759759
import std.array : array;
760760
const(dchar)[] c = "foo,bar\n";
761761
assert(csvReader(c).map!array.array == [["foo", "bar"]]);
@@ -907,17 +907,18 @@ public:
907907
{
908908
static if (is(Contents T : T[U], U : string))
909909
{
910-
import std.algorithm : sort;
910+
import std.algorithm.sorting : sort;
911911
sort(indices);
912912
}
913913
else static if (ErrorLevel == Malformed.ignore)
914914
{
915-
import std.algorithm : sort;
915+
import std.algorithm.sorting : sort;
916916
sort(indices);
917917
}
918918
else
919919
{
920-
import std.algorithm : isSorted, findAdjacent;
920+
import std.algorithm.searching : findAdjacent;
921+
import std.algorithm.sorting : isSorted;
921922
if (!isSorted(indices))
922923
{
923924
auto ex = new HeaderMismatchException

std/digest/digest.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ version(ExampleDigest)
256256
unittest
257257
{
258258
//Using the OutputRange feature
259-
import std.algorithm : copy;
259+
import std.algorithm.mutation : copy;
260260
import std.range : repeat;
261261
import std.digest.md;
262262

@@ -427,7 +427,7 @@ package template isDigestibleRange(Range)
427427
DigestType!Hash digest(Hash, Range)(auto ref Range range) if (!isArray!Range
428428
&& isDigestibleRange!Range)
429429
{
430-
import std.algorithm : copy;
430+
import std.algorithm.mutation : copy;
431431
Hash hash;
432432
hash.start();
433433
copy(range, &hash);
@@ -621,7 +621,7 @@ interface Digest
621621
unittest
622622
{
623623
//Using the OutputRange feature
624-
import std.algorithm : copy;
624+
import std.algorithm.mutation : copy;
625625
import std.range : repeat;
626626
import std.digest.md;
627627

std/digest/hmac.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ if (isDigest!H)
270270
{
271271
import std.digest.sha, std.digest.hmac;
272272
import std.string : representation;
273-
import std.algorithm : map;
273+
import std.algorithm.iteration : map;
274274
string data = "Hello, world";
275275
auto digest = data.representation
276276
.map!(a => cast(ubyte)(a+1))

std/exception.d

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,7 +1964,8 @@ auto handle(E : Throwable, RangePrimitive primitivesToHandle, alias handler, Ran
19641964
///
19651965
pure @safe unittest
19661966
{
1967-
import std.algorithm : equal, map, splitter;
1967+
import std.algorithm.comparison : equal;
1968+
import std.algorithm.iteration : map, splitter;
19681969
import std.conv : to, ConvException;
19691970

19701971
auto s = "12,1337z32,54,2,7,9,1z,6,8";
@@ -1981,7 +1982,7 @@ pure @safe unittest
19811982
///
19821983
pure @safe unittest
19831984
{
1984-
import std.algorithm : equal;
1985+
import std.algorithm.comparison : equal;
19851986
import std.range : retro;
19861987
import std.utf : UTFException;
19871988

std/experimental/logger/multilogger.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class MultiLogger : Logger
6969
*/
7070
Logger removeLogger(in char[] toRemove) @safe
7171
{
72-
import std.algorithm : copy;
72+
import std.algorithm.mutation : copy;
7373
import std.range.primitives : back, popBack;
7474
for (size_t i = 0; i < this.logger.length; ++i)
7575
{

0 commit comments

Comments
 (0)