4 changes: 2 additions & 2 deletions std/net/isemail.d
Original file line number Diff line number Diff line change
Expand Up @@ -1752,12 +1752,12 @@ enum AsciiToken
*/
T max (T) (T[] arr)
{
import std.algorithm/* : max*/;
static import std.algorithm.comparison;

auto max = arr.front;

foreach (i ; 0 .. arr.length - 1)
max = std.algorithm.max(max, arr[i + 1]);
max = std.algorithm.comparison.max(max, arr[i + 1]);

return max;
}
Expand Down
8 changes: 4 additions & 4 deletions std/numeric.d
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ struct CustomFloat(uint precision, // fraction bits (23 for float)
if (((flags & flags.signed) + precision + exponentWidth) % 8 == 0 &&
precision + exponentWidth > 0)
{
import std.bitmanip;
import std.meta;
import std.bitmanip : bitfields;
import std.meta : staticIndexOf;
private:
// get the correct unsigned bitfield type to support > 32 bits
template uType(uint bits)
Expand Down Expand Up @@ -2159,7 +2159,7 @@ F gapWeightedSimilarity(alias comp = "a == b", R1, R2, F)(R1 s, R2 t, F lambda)
{
import std.functional : binaryFun;
import std.algorithm : swap;
import core.stdc.stdlib;
import core.stdc.stdlib : malloc, free;

if (s.length < t.length) return gapWeightedSimilarity(t, s, lambda);
if (!t.length) return 0;
Expand Down Expand Up @@ -2281,7 +2281,7 @@ optimizations.
struct GapWeightedSimilarityIncremental(Range, F = double)
if (isRandomAccessRange!(Range) && hasLength!(Range))
{
import core.stdc.stdlib;
import core.stdc.stdlib : malloc, realloc, alloca, free;

private:
Range s, t;
Expand Down
12 changes: 5 additions & 7 deletions std/parallelism.d
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ version(Windows)
// BUGS: Only works on Windows 2000 and above.
shared static this()
{
import core.sys.windows.windows;
import core.sys.windows.windows : SYSTEM_INFO, GetSystemInfo;

SYSTEM_INFO si;
GetSystemInfo(&si);
Expand All @@ -119,19 +119,17 @@ version(Windows)
}
else version(linux)
{
import core.sys.posix.unistd;

shared static this()
{
import core.sys.posix.unistd : _SC_NPROCESSORS_ONLN, sysconf;
totalCPUs = cast(uint) sysconf(_SC_NPROCESSORS_ONLN);
}
}
else version(Solaris)
{
import core.sys.posix.unistd;

shared static this()
{
import core.sys.posix.unistd : _SC_NPROCESSORS_ONLN, sysconf;
totalCPUs = cast(uint) sysconf(_SC_NPROCESSORS_ONLN);
}
}
Expand Down Expand Up @@ -2604,7 +2602,7 @@ public:
byte[maxStack] buf = void;
immutable size_t nBytesNeeded = nWorkUnits * RTask.sizeof;

import core.stdc.stdlib;
import core.stdc.stdlib : malloc, free;
if (nBytesNeeded < maxStack)
{
tasks = (cast(RTask*) buf.ptr)[0..nWorkUnits];
Expand Down Expand Up @@ -3344,7 +3342,7 @@ private void submitAndExecute(
immutable nThreads = pool.size + 1;

alias PTask = typeof(scopedTask(doIt));
import core.stdc.stdlib;
import core.stdc.stdlib : malloc, free;
import core.stdc.string : memcpy;

// The logical thing to do would be to just use alloca() here, but that
Expand Down