Skip to content

Commit

Permalink
style fix: add space after for operator
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Apr 26, 2016
1 parent ff298c7 commit 5a8988c
Show file tree
Hide file tree
Showing 35 changed files with 139 additions and 139 deletions.
4 changes: 2 additions & 2 deletions std/algorithm/comparison.d
Expand Up @@ -1870,14 +1870,14 @@ bool isPermutation(alias pred = "a == b", Range1, Range2)
// of item in the scanning loop has an index smaller than the current index,
// then you know that the element has been seen before
size_t index;
outloop: for(auto r1s1 = r1.save; !r1s1.empty; r1s1.popFront, index++)
outloop: for (auto r1s1 = r1.save; !r1s1.empty; r1s1.popFront, index++)
{
auto item = r1s1.front;
r1_count = 0;
r2_count = 0;

size_t i;
for(auto r1s2 = r1.save; !r1s2.empty; r1s2.popFront, i++)
for (auto r1s2 = r1.save; !r1s2.empty; r1s2.popFront, i++)
{
auto e = r1s2.front;
if (predEquals(e, item) && i < index)
Expand Down
2 changes: 1 addition & 1 deletion std/algorithm/sorting.d
Expand Up @@ -1620,7 +1620,7 @@ private template TimSortImpl(alias pred, R)
//11 instructions vs 7 in the innermost loop [checked on Win32]
//moveAll(retro(range[lower .. sortedLen]),
// retro(range[lower+1 .. sortedLen+1]));
for(upper=sortedLen; upper > lower; upper--)
for (upper=sortedLen; upper > lower; upper--)
range[upper] = range.moveAt(upper - 1);
range[lower] = move(item);
}
Expand Down
2 changes: 1 addition & 1 deletion std/bitmanip.d
Expand Up @@ -2241,7 +2241,7 @@ unittest
left <<= (T.sizeof - 1) * 8;
T right = 0xffU;

for(size_t i = 1; i < T.sizeof; ++i)
for (size_t i = 1; i < T.sizeof; ++i)
{
assert(swapEndian(left) == right);
assert(swapEndian(right) == left);
Expand Down
6 changes: 3 additions & 3 deletions std/concurrency.d
Expand Up @@ -1390,7 +1390,7 @@ private:
import core.time;
scope(exit) notified = false;

for( auto limit = MonoTime.currTime + period;
for ( auto limit = MonoTime.currTime + period;
!notified && !period.isNegative;
period = limit - MonoTime.currTime )
{
Expand Down Expand Up @@ -1986,7 +1986,7 @@ private

bool scan( ref ListT list )
{
for( auto range = list[]; !range.empty; )
for ( auto range = list[]; !range.empty; )
{
// Only the message handler will throw, so if this occurs
// we can be certain that the message was handled.
Expand Down Expand Up @@ -2130,7 +2130,7 @@ private

void sweep( ref ListT list )
{
for( auto range = list[]; !range.empty; range.popFront() )
for ( auto range = list[]; !range.empty; range.popFront() )
{
if ( range.front.type == MsgType.linkDead )
onLinkDeadMsg( range.front );
Expand Down
8 changes: 4 additions & 4 deletions std/container/dlist.d
Expand Up @@ -771,7 +771,7 @@ private:
alias IntList = DList!int;
IntList list = IntList([0,1,2,3]);
auto range = list[];
for( ; !range.empty; range.popFront())
for ( ; !range.empty; range.popFront())
{
int item = range.front;
if (item == 2)
Expand All @@ -784,7 +784,7 @@ private:

list = IntList([0,1,2,3]);
range = list[];
for( ; !range.empty; range.popFront())
for ( ; !range.empty; range.popFront())
{
int item = range.front;
if (item == 2)
Expand All @@ -797,7 +797,7 @@ private:

list = IntList([0,1,2,3]);
range = list[];
for( ; !range.empty; range.popFront())
for ( ; !range.empty; range.popFront())
{
int item = range.front;
if (item == 0)
Expand All @@ -810,7 +810,7 @@ private:

list = IntList([0,1,2,3]);
range = list[];
for( ; !range.empty; range.popFront())
for ( ; !range.empty; range.popFront())
{
int item = range.front;
if (item == 1)
Expand Down
4 changes: 2 additions & 2 deletions std/container/rbtree.d
Expand Up @@ -1638,14 +1638,14 @@ assert(equal(rbt[], [5]));
if (n !is null)
{
printTree(n.right, indent + 2);
for(int i = 0; i < indent; i++)
for (int i = 0; i < indent; i++)
write(".");
writeln(n.color == n.color.Black ? "B" : "R");
printTree(n.left, indent + 2);
}
else
{
for(int i = 0; i < indent; i++)
for (int i = 0; i < indent; i++)
write(".");
writeln("N");
}
Expand Down
4 changes: 2 additions & 2 deletions std/csv.d
Expand Up @@ -1036,7 +1036,7 @@ public:
T[U] aa;
try
{
for(; !recordRange.empty; recordRange.popFront())
for (; !recordRange.empty; recordRange.popFront())
{
aa[header[_input.col-1]] = recordRange.front;
}
Expand All @@ -1057,7 +1057,7 @@ public:
size_t colIndex;
try
{
for(; !recordRange.empty;)
for (; !recordRange.empty;)
{
auto colData = recordRange.front;
scope(exit) colIndex++;
Expand Down
2 changes: 1 addition & 1 deletion std/datetime.d
Expand Up @@ -33898,7 +33898,7 @@ R _stripCFWS(R)(R range)
(is(Unqual!(ElementType!R) == char) || is(Unqual!(ElementType!R) == ubyte)))
{
immutable e = range.length;
outer: for(size_t i = 0; i < e; )
outer: for (size_t i = 0; i < e; )
{
switch (range[i])
{
Expand Down
4 changes: 2 additions & 2 deletions std/digest/md.d
Expand Up @@ -194,7 +194,7 @@ struct MD5
{
import std.bitmanip : littleEndianToNative;

for(size_t i = 0; i < 16; i++)
for (size_t i = 0; i < 16; i++)
{
x[i] = littleEndianToNative!uint(*cast(ubyte[4]*)&(*block)[i*4]);
}
Expand Down Expand Up @@ -321,7 +321,7 @@ struct MD5
(&_buffer[index])[0 .. partLen] = data.ptr[0 .. partLen];
transform(&_buffer);

for(i = partLen; i + 63 < inputLen; i += 64)
for (i = partLen; i + 63 < inputLen; i += 64)
{
transform(cast(const(ubyte[64])*)(data[i .. i + 64].ptr));
}
Expand Down
4 changes: 2 additions & 2 deletions std/digest/ripemd.d
Expand Up @@ -239,7 +239,7 @@ struct RIPEMD160
{
import std.bitmanip : littleEndianToNative;

for(size_t i = 0; i < 16; i++)
for (size_t i = 0; i < 16; i++)
{
x[i] = littleEndianToNative!uint(*cast(ubyte[4]*)&(*block)[i*4]);
}
Expand Down Expand Up @@ -477,7 +477,7 @@ struct RIPEMD160
(&_buffer[index])[0 .. partLen] = data.ptr[0 .. partLen];
transform(&_buffer);

for(i = partLen; i + 63 < inputLen; i += 64)
for (i = partLen; i + 63 < inputLen; i += 64)
{
transform(cast(const(ubyte[64])*)(data[i .. i + 64].ptr));
}
Expand Down
4 changes: 2 additions & 2 deletions std/encoding.d
Expand Up @@ -244,7 +244,7 @@ unittest

// Make sure we can sanitize everything bad
assert(invalidStrings.length == sanitizedStrings.length);
for(int i=0; i<invalidStrings.length; ++i)
for (int i=0; i<invalidStrings.length; ++i)
{
string s = cast(string)invalidStrings[i];
string t = sanitize(s);
Expand Down Expand Up @@ -2114,7 +2114,7 @@ size_t encode(Tgt, Src, R)(in Src[] s, R range)
}
--------------------------------------------------------
Note that, currently, foreach (c:codePoints(s)) is superior to foreach(c;s)
Note that, currently, foreach (c:codePoints(s)) is superior to foreach (c;s)
in that the latter will fall over on encountering U+FFFF.
*/
CodePoints!(E) codePoints(E)(immutable(E)[] s)
Expand Down
2 changes: 1 addition & 1 deletion std/experimental/allocator/gc_allocator.d
Expand Up @@ -140,7 +140,7 @@ unittest

// test allocation sizes
assert(GCAllocator.instance.goodAllocSize(1) == 16);
for(size_t s = 16; s <= 8192; s *= 2)
for (size_t s = 16; s <= 8192; s *= 2)
{
assert(GCAllocator.instance.goodAllocSize(s) == s);
assert(GCAllocator.instance.goodAllocSize(s - (s / 2) + 1) == s);
Expand Down
2 changes: 1 addition & 1 deletion std/experimental/ndslice/selection.d
Expand Up @@ -1206,7 +1206,7 @@ pure nothrow unittest
import std.experimental.ndslice.slice;
auto slice = new long[20].sliced(5, 4);

for(auto elems = slice.byElement; !elems.empty; elems.popFront)
for (auto elems = slice.byElement; !elems.empty; elems.popFront)
{
size_t[2] index = elems.index;
elems.front = index[0] * 10 + index[1] * 3;
Expand Down
2 changes: 1 addition & 1 deletion std/file.d
Expand Up @@ -3612,7 +3612,7 @@ private struct DirIteratorImpl
{
if (_stack.data.empty)
return false;
for(dirent* fdata; (fdata = readdir(_stack.data[$-1].h)) != null; )
for (dirent* fdata; (fdata = readdir(_stack.data[$-1].h)) != null; )
{
// Skip "." and ".."
if (core.stdc.string.strcmp(fdata.d_name.ptr, ".") &&
Expand Down
2 changes: 1 addition & 1 deletion std/internal/math/biguintcore.d
Expand Up @@ -2260,7 +2260,7 @@ void toHexZeroPadded(char[] output, uint value,
ptrdiff_t x = output.length - 1;
static immutable string upperHexDigits = "0123456789ABCDEF";
static immutable string lowerHexDigits = "0123456789abcdef";
for( ; x>=0; --x)
for ( ; x>=0; --x)
{
if (letterCase == LetterCase.upper)
{
Expand Down
10 changes: 5 additions & 5 deletions std/internal/math/biguintnoasm.d
Expand Up @@ -159,7 +159,7 @@ void multibyteShr(uint [] dest, const(uint) [] src, uint numbits)
pure @nogc @safe
{
ulong c = 0;
for(ptrdiff_t i = dest.length; i!=0; --i)
for (ptrdiff_t i = dest.length; i!=0; --i)
{
c += (src[i-1] >>numbits) + (cast(ulong)(src[i-1]) << (64 - numbits));
dest[i-1] = cast(uint)c;
Expand Down Expand Up @@ -195,7 +195,7 @@ uint multibyteMul(uint[] dest, const(uint)[] src, uint multiplier, uint carry)
{
assert(dest.length == src.length);
ulong c = carry;
for(size_t i = 0; i < src.length; ++i)
for (size_t i = 0; i < src.length; ++i)
{
c += cast(ulong)(src[i]) * multiplier;
dest[i] = cast(uint)c;
Expand All @@ -222,7 +222,7 @@ uint multibyteMulAdd(char op)(uint [] dest, const(uint)[] src,
{
assert(dest.length == src.length);
ulong c = carry;
for(size_t i = 0; i < src.length; ++i)
for (size_t i = 0; i < src.length; ++i)
{
static if (op=='+')
{
Expand Down Expand Up @@ -285,7 +285,7 @@ uint multibyteDivAssign(uint [] dest, uint divisor, uint overflow)
pure @nogc @safe
{
ulong c = cast(ulong)overflow;
for(ptrdiff_t i = dest.length-1; i>= 0; --i)
for (ptrdiff_t i = dest.length-1; i>= 0; --i)
{
c = (c<<32) + cast(ulong)(dest[i]);
uint q = cast(uint)(c/divisor);
Expand Down Expand Up @@ -314,7 +314,7 @@ void multibyteAddDiagonalSquares(uint[] dest, const(uint)[] src)
pure @nogc @safe
{
ulong c = 0;
for(size_t i = 0; i < src.length; ++i)
for (size_t i = 0; i < src.length; ++i)
{
// At this point, c is 0 or 1, since FFFF*FFFF+FFFF_FFFF = 1_0000_0000.
c += cast(ulong)(src[i]) * src[i] + dest[2*i];
Expand Down
12 changes: 6 additions & 6 deletions std/internal/math/gammafunction.d
Expand Up @@ -753,7 +753,7 @@ ihalve:

dir = 0;
di = 0.5L;
for( i=0; i<400; i++ ) {
for ( i=0; i<400; i++ ) {
if ( i != 0 ) {
x = x0 + di * (x1 - x0);
if ( x == 1.0L ) {
Expand Down Expand Up @@ -846,7 +846,7 @@ newt:
nflg = 1;
lgm = logGamma(a+b) - logGamma(a) - logGamma(b);

for( i=0; i<15; i++ ) {
for ( i=0; i<15; i++ ) {
/* Compute the function at this point. */
if ( i != 0 )
y = betaIncomplete(a,b,x);
Expand Down Expand Up @@ -1346,7 +1346,7 @@ body {

lgm = logGamma(a);

for( i=0; i<10; i++ ) {
for ( i=0; i<10; i++ ) {
if ( x > x0 || x < x1 )
goto ihalve;
y = gammaIncompleteCompl(a,x);
Expand Down Expand Up @@ -1391,7 +1391,7 @@ ihalve:
d = 0.5L;
dir = 0;

for( i=0; i<400; i++ ) {
for ( i=0; i<400; i++ ) {
x = x1 + d * (x0 - x1);
y = gammaIncompleteCompl( a, x );
lgm = (x0 - x1)/(x1 + x0);
Expand Down Expand Up @@ -1603,9 +1603,9 @@ unittest {
assert(logmdigamma(-5.0).isNaN());
assert(isIdentical(logmdigamma(NaN(0xABC)), NaN(0xABC)));
assert(logmdigamma(0.0) == real.infinity);
for(auto x = 0.01; x < 1.0; x += 0.1)
for (auto x = 0.01; x < 1.0; x += 0.1)
assert(approxEqual(digamma(x), log(x) - logmdigamma(x)));
for(auto x = 1.0; x < 15.0; x += 1.0)
for (auto x = 1.0; x < 15.0; x += 1.0)
assert(approxEqual(digamma(x), log(x) - logmdigamma(x)));
}

Expand Down
10 changes: 5 additions & 5 deletions std/parallelism.d
Expand Up @@ -1922,7 +1922,7 @@ public:
assert(from !is null);

size_t i;
for(; !source.empty && i < from.length; source.popFront())
for (; !source.empty && i < from.length; source.popFront())
{
from[i++] = source.front;
}
Expand Down Expand Up @@ -2180,7 +2180,7 @@ public:
assert(buf !is null);

size_t i;
for(; !source.empty && i < buf.length; source.popFront())
for (; !source.empty && i < buf.length; source.popFront())
{
buf[i++] = source.front;
}
Expand Down Expand Up @@ -3617,7 +3617,7 @@ enum string parallelApplyMixinInputRange = q{
scope(exit) rangeMutex.unlock();

size_t i = 0;
for(; i < workUnitSize && !range.empty; range.popFront(), i++)
for (; i < workUnitSize && !range.empty; range.popFront(), i++)
{
temp[i] = addressOf(range.front);
}
Expand Down Expand Up @@ -3647,7 +3647,7 @@ enum string parallelApplyMixinInputRange = q{
scope(exit) rangeMutex.unlock();

size_t i = 0;
for(; i < workUnitSize && !range.empty; range.popFront(), i++)
for (; i < workUnitSize && !range.empty; range.popFront(), i++)
{
temp[i] = range.front;
}
Expand Down Expand Up @@ -4296,7 +4296,7 @@ version(parallelismStressTest)
unittest
{
size_t attempt;
for(; attempt < 10; attempt++)
for (; attempt < 10; attempt++)
foreach (poolSize; [0, 4])
{

Expand Down
4 changes: 2 additions & 2 deletions std/range/interfaces.d
Expand Up @@ -404,7 +404,7 @@ template InputRangeObject(R) if (isInputRange!(Unqual!R)) {
int opApply(int delegate(E) dg) {
int res;

for(auto r = _range; !r.empty; r.popFront()) {
for (auto r = _range; !r.empty; r.popFront()) {
res = dg(r.front);
if (res) break;
}
Expand All @@ -416,7 +416,7 @@ template InputRangeObject(R) if (isInputRange!(Unqual!R)) {
int res;

size_t i = 0;
for(auto r = _range; !r.empty; r.popFront()) {
for (auto r = _range; !r.empty; r.popFront()) {
res = dg(i, r.front);
if (res) break;
i++;
Expand Down

0 comments on commit 5a8988c

Please sign in to comment.