Skip to content

Commit 7f9f0aa

Browse files
authored
Merge pull request #5481 from CyberShadow/pull-20170613-175151
Revert "Sort selective imports" merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2 parents 9b5a541 + d0b9555 commit 7f9f0aa

70 files changed

Lines changed: 222 additions & 222 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

std/algorithm/comparison.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import std.range.primitives;
6464
import std.traits;
6565
// FIXME
6666
import std.meta : allSatisfy;
67-
import std.typecons; // : Flag, Tuple, tuple, Yes;
67+
import std.typecons; // : tuple, Tuple, Flag, Yes;
6868

6969
/**
7070
Find $(D value) _among $(D values), returning the 1-based index
@@ -852,7 +852,7 @@ range of range (of range...) comparisons.
852852
@safe unittest
853853
{
854854
import std.algorithm.comparison : equal;
855-
import std.range : chunks, iota;
855+
import std.range : iota, chunks;
856856
assert(equal!(equal!equal)(
857857
[[[0, 1], [2, 3]], [[4, 5], [6, 7]]],
858858
iota(0, 8).chunks(2).chunks(2)
@@ -925,7 +925,7 @@ range of range (of range...) comparisons.
925925

926926
@safe pure unittest
927927
{
928-
import std.utf : byChar, byDchar, byWchar;
928+
import std.utf : byChar, byWchar, byDchar;
929929

930930
assert(equal("æøå".byChar, "æøå"));
931931
assert(equal("æøå", "æøå".byChar));

std/algorithm/internal.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ version(unittest)
2121

2222
package string[] rndstuff(T : string)()
2323
{
24-
import std.random : Random, uniform, unpredictableSeed;
24+
import std.random : Random, unpredictableSeed, uniform;
2525

2626
static Random rnd;
2727
static bool first = true;
@@ -46,7 +46,7 @@ version(unittest)
4646

4747
package int[] rndstuff(T : int)()
4848
{
49-
import std.random : Random, uniform, unpredictableSeed;
49+
import std.random : Random, unpredictableSeed, uniform;
5050

5151
static Random rnd;
5252
static bool first = true;

std/algorithm/iteration.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2748,7 +2748,7 @@ if (fun.length >= 1)
27482748

27492749
alias binfuns = staticMap!(binaryFun, fun);
27502750
static if (fun.length > 1)
2751-
import std.typecons : isTuple, tuple;
2751+
import std.typecons : tuple, isTuple;
27522752

27532753
/++
27542754
No-seed version. The first element of $(D r) is used as the seed's value.
@@ -3219,7 +3219,7 @@ if (fun.length >= 1)
32193219
// Sum all elements with explicit seed
32203220
assert(arr.fold!((a, b) => a + b)(6) == 21);
32213221

3222-
import std.algorithm.comparison : max, min;
3222+
import std.algorithm.comparison : min, max;
32233223
import std.typecons : tuple;
32243224

32253225
// Compute minimum and maximum at the same time

std/algorithm/mutation.d

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ T2=$(TR $(TDNW $(LREF $1)) $(TD $+))
7878
module std.algorithm.mutation;
7979

8080
import std.range.primitives;
81-
import std.traits : isArray, isBlitAssignable, isNarrowString, isSomeChar, Unqual;
81+
import std.traits : isArray, isBlitAssignable, isNarrowString, Unqual, isSomeChar;
8282
// FIXME
8383
import std.typecons; // : tuple, Tuple;
8484

@@ -279,7 +279,7 @@ Unicode integrity is not preserved:
279279
{
280280
import std.algorithm.comparison : equal;
281281
import std.conv : text;
282-
import std.random : Random, uniform, unpredictableSeed;
282+
import std.random : Random, unpredictableSeed, uniform;
283283

284284
// a more elaborate test
285285
{
@@ -845,7 +845,7 @@ See_Also:
845845
void initializeAll(Range)(Range range)
846846
if (isInputRange!Range && hasLvalueElements!Range && hasAssignableElements!Range)
847847
{
848-
import core.stdc.string : memcpy, memset;
848+
import core.stdc.string : memset, memcpy;
849849
import std.traits : hasElaborateAssign, isDynamicArray;
850850

851851
alias T = ElementType!Range;
@@ -901,7 +901,7 @@ if (is(Range == char[]) || is(Range == wchar[]))
901901
///
902902
@system unittest
903903
{
904-
import core.stdc.stdlib : free, malloc;
904+
import core.stdc.stdlib : malloc, free;
905905

906906
struct S
907907
{
@@ -2835,7 +2835,7 @@ if (isInputRange!Range && hasLvalueElements!Range && is(typeof(range.front = val
28352835
///
28362836
nothrow @system unittest
28372837
{
2838-
import core.stdc.stdlib : free, malloc;
2838+
import core.stdc.stdlib : malloc, free;
28392839

28402840
auto s = (cast(int*) malloc(5 * int.sizeof))[0 .. 5];
28412841
uninitializedFill(s, 42);

std/algorithm/setops.d

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ module std.algorithm.setops;
4141
import std.range.primitives;
4242

4343
// FIXME
44-
import std.functional; // : binaryFun, unaryFun;
44+
import std.functional; // : unaryFun, binaryFun;
4545
import std.traits;
4646
// FIXME
47-
import std.meta; // : AliasSeq, allSatisfy, anySatisfy, staticMap;
47+
import std.meta; // : AliasSeq, staticMap, allSatisfy, anySatisfy;
4848

4949
import std.algorithm.sorting; // : Merge;
5050
import std.typecons : No;
@@ -82,13 +82,13 @@ auto cartesianProduct(R1, R2)(R1 range1, R2 range2)
8282
if (!allSatisfy!(isForwardRange, R1, R2) ||
8383
anySatisfy!(isInfinite, R1, R2))
8484
{
85-
import std.algorithm.iteration : joiner, map;
85+
import std.algorithm.iteration : map, joiner;
8686

8787
static if (isInfinite!R1 && isInfinite!R2)
8888
{
8989
static if (isForwardRange!R1 && isForwardRange!R2)
9090
{
91-
import std.range : chain, repeat, sequence, take, zip;
91+
import std.range : zip, repeat, take, chain, sequence;
9292

9393
// This algorithm traverses the cartesian product by alternately
9494
// covering the right and bottom edges of an increasing square area
@@ -107,13 +107,13 @@ if (!allSatisfy!(isForwardRange, R1, R2) ||
107107
}
108108
else static if (isInputRange!R1 && isForwardRange!R2 && !isInfinite!R2)
109109
{
110-
import std.range : repeat, zip;
110+
import std.range : zip, repeat;
111111
return joiner(map!((ElementType!R1 a) => zip(repeat(a), range2.save))
112112
(range1));
113113
}
114114
else static if (isInputRange!R2 && isForwardRange!R1 && !isInfinite!R1)
115115
{
116-
import std.range : repeat, zip;
116+
import std.range : zip, repeat;
117117
return joiner(map!((ElementType!R2 a) => zip(range1.save, repeat(a)))
118118
(range2));
119119
}

std/algorithm/sorting.d

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void completeSort(alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable,
116116
if (hasLength!(RandomAccessRange2) && hasSlicing!(RandomAccessRange2))
117117
{
118118
import std.algorithm.mutation : bringToFront;
119-
import std.range : assumeSorted, chain;
119+
import std.range : chain, assumeSorted;
120120
// Probably this algorithm can be optimized by using in-place
121121
// merge
122122
auto lhsOriginal = lhs.release();
@@ -619,7 +619,7 @@ if (isRandomAccessRange!Range && hasLength!Range && hasSlicing!Range)
619619
{
620620
assert(pivot < r.length || r.length == 0 && pivot == 0);
621621
if (r.length <= 1) return 0;
622-
import std.algorithm.mutation : move, swapAt;
622+
import std.algorithm.mutation : swapAt, move;
623623
alias lt = binaryFun!less;
624624

625625
// Pivot at the front
@@ -1939,7 +1939,7 @@ if (((ss == SwapStrategy.unstable && (hasSwappableElements!Range ||
19391939
{
19401940
import std.algorithm.internal : rndstuff;
19411941
import std.algorithm.mutation : swapRanges;
1942-
import std.random : Random, uniform, unpredictableSeed;
1942+
import std.random : Random, unpredictableSeed, uniform;
19431943
import std.uni : toUpper;
19441944

19451945
// sort using delegate
@@ -2038,7 +2038,7 @@ if (((ss == SwapStrategy.unstable && (hasSwappableElements!Range ||
20382038

20392039
private void quickSortImpl(alias less, Range)(Range r, size_t depth)
20402040
{
2041-
import std.algorithm.comparison : max, min;
2041+
import std.algorithm.comparison : min, max;
20422042
import std.algorithm.mutation : swap, swapAt;
20432043

20442044
alias Elem = ElementType!(Range);
@@ -2736,7 +2736,7 @@ private template TimSortImpl(alias pred, R)
27362736

27372737
@safe unittest
27382738
{
2739-
import std.random : Random, randomShuffle, uniform;
2739+
import std.random : Random, uniform, randomShuffle;
27402740

27412741
// Element type with two fields
27422742
static struct E
@@ -2893,7 +2893,7 @@ schwartzSort(alias transform, alias less = "a < b",
28932893
if (isRandomAccessRange!R && hasLength!R)
28942894
{
28952895
import std.conv : emplace;
2896-
import std.range : SortedRange, zip;
2896+
import std.range : zip, SortedRange;
28972897
import std.string : representation;
28982898

28992899
alias T = typeof(unaryFun!transform(r.front));
@@ -3437,7 +3437,7 @@ private T[] randomArray(Flag!"exactSize" flag = No.exactSize, T = int)(
34373437
T minValue = 0, T maxValue = 255)
34383438
{
34393439
import std.algorithm.iteration : map;
3440-
import std.random : Random, uniform, unpredictableSeed;
3440+
import std.random : unpredictableSeed, Random, uniform;
34413441
auto size = flag == Yes.exactSize ? maxSize : uniform(1, maxSize);
34423442
return iota(0, size).map!(_ => uniform(minValue, maxValue)).array;
34433443
}
@@ -3698,7 +3698,7 @@ if (isInputRange!(SRange) && isRandomAccessRange!(TRange)
36983698

36993699
@system unittest
37003700
{
3701-
import std.random : Random, randomShuffle, uniform, unpredictableSeed;
3701+
import std.random : Random, unpredictableSeed, uniform, randomShuffle;
37023702
import std.typecons : Yes;
37033703

37043704
auto r = Random(unpredictableSeed);

std/array.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ import std.meta;
8282
import std.traits;
8383

8484
import std.range.primitives;
85-
public import std.range.primitives : back, empty, front, popBack, popFront, save;
85+
public import std.range.primitives : save, empty, popFront, popBack, front, back;
8686

8787
/**
8888
* Allocates an array and initializes it with copies of the elements
@@ -744,7 +744,7 @@ slice, returns that slice. Otherwise, returns the null slice.
744744
auto overlap(T, U)(T[] r1, U[] r2) @trusted pure nothrow
745745
if (is(typeof(r1.ptr < r2.ptr) == bool))
746746
{
747-
import std.algorithm.comparison : max, min;
747+
import std.algorithm.comparison : min, max;
748748
auto b = max(r1.ptr, r2.ptr);
749749
auto e = min(r1.ptr + r1.length, r2.ptr + r2.length);
750750
return b < e ? b[0 .. e - b] : null;

std/bigint.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module std.bigint;
2727

2828
import std.conv : ConvException;
2929

30-
private import std.format : FormatException, FormatSpec;
30+
private import std.format : FormatSpec, FormatException;
3131
private import std.internal.math.biguintcore;
3232
private import std.range.primitives;
3333
private import std.traits;
@@ -674,7 +674,7 @@ public:
674674
///
675675
@system unittest
676676
{
677-
import std.conv : ConvOverflowException, to;
677+
import std.conv : to, ConvOverflowException;
678678
import std.exception : assertThrown;
679679

680680
assert(BigInt("0").to!int == 0);
@@ -687,7 +687,7 @@ public:
687687

688688
@system unittest
689689
{
690-
import std.conv : ConvOverflowException, to;
690+
import std.conv : to, ConvOverflowException;
691691
import std.exception : assertThrown;
692692

693693
assert(BigInt("-1").to!byte == -1);

std/bitmanip.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ struct BitArray
772772
{
773773
private:
774774

775-
import core.bitop : bsf, bt, btr, bts;
775+
import core.bitop : bts, btr, bsf, bt;
776776
import std.format : FormatSpec;
777777

778778
size_t _len;
@@ -2052,7 +2052,7 @@ public:
20522052
*/
20532053
@property auto bitsSet() const nothrow
20542054
{
2055-
import std.algorithm.iteration : filter, joiner, map;
2055+
import std.algorithm.iteration : filter, map, joiner;
20562056
import std.range : iota;
20572057

20582058
return iota(dim).

std/c/freebsd/socket.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ public import core.sys.posix.netdb;
1414
public import core.sys.posix.netinet.in_ : IPPROTO_IGMP, IPPROTO_GGP,
1515
IPPROTO_PUP, IPPROTO_IDP, IPPROTO_ND,
1616
IPPROTO_MAX, INADDR_LOOPBACK, INADDR_NONE;
17-
public import core.sys.posix.sys.socket : AF_APPLETALK, AF_IPX, MSG_NOSIGNAL, SOCK_RDM;
17+
public import core.sys.posix.sys.socket : AF_APPLETALK, AF_IPX, SOCK_RDM, MSG_NOSIGNAL;

0 commit comments

Comments
 (0)