diff --git a/std/experimental/allocator/gc_allocator.d b/std/experimental/allocator/gc_allocator.d index 4ccbd8cc1c7..c87f2567731 100644 --- a/std/experimental/allocator/gc_allocator.d +++ b/std/experimental/allocator/gc_allocator.d @@ -39,7 +39,7 @@ struct GCAllocator immutable curLength = GC.sizeOf(b.ptr); assert(curLength != 0); // we have a valid GC pointer here immutable desired = b.length + delta; - if(desired > curLength) // check to see if the current block can't hold the data + if (desired > curLength) // check to see if the current block can't hold the data { immutable sizeRequest = desired - curLength; immutable newSize = GC.extend(b.ptr, sizeRequest, sizeRequest); @@ -89,9 +89,9 @@ struct GCAllocator /// Ditto size_t goodAllocSize(size_t n) shared { - if(n == 0) + if (n == 0) return 0; - if(n <= 16) + if (n <= 16) return 16; import core.bitop: bsr; diff --git a/std/experimental/allocator/mallocator.d b/std/experimental/allocator/mallocator.d index 4d4d7ef8be7..4c6b162585a 100644 --- a/std/experimental/allocator/mallocator.d +++ b/std/experimental/allocator/mallocator.d @@ -157,7 +157,7 @@ version (Windows) import std.c.stdlib: free; import std.c.string: memcpy; - if(!ptr) return _aligned_malloc(size, alignment); + if (!ptr) return _aligned_malloc(size, alignment); // gets the header from the exising pointer AlignInfo* head = AlignInfo(ptr); diff --git a/std/experimental/ndslice/internal.d b/std/experimental/ndslice/internal.d index 1076189e0bb..12e2515ccf9 100644 --- a/std/experimental/ndslice/internal.d +++ b/std/experimental/ndslice/internal.d @@ -11,7 +11,7 @@ enum indexError(size_t pos, size_t N) = ~ " must be less than corresponding length."; enum indexStrideCode = q{ - static if(_indexes.length) + static if (_indexes.length) { size_t stride = _strides[0] * _indexes[0]; assert(_indexes[0] < _lengths[0], indexError!(0, N)); @@ -29,7 +29,7 @@ enum indexStrideCode = q{ }; enum mathIndexStrideCode = q{ - static if(_indexes.length) + static if (_indexes.length) { size_t stride = _strides[0] * _indexes[N - 1]; assert(_indexes[N - 1] < _lengths[0], indexError!(N - 1, N)); diff --git a/std/experimental/ndslice/selection.d b/std/experimental/ndslice/selection.d index 9d21f7c7fb4..d166916d45a 100644 --- a/std/experimental/ndslice/selection.d +++ b/std/experimental/ndslice/selection.d @@ -767,7 +767,7 @@ Slice!(Lengths.length, Range) } ret._strides[nj - 1] = slice._strides[oj - 1]; - foreach_reverse(i; ni .. nj - 1) + foreach_reverse (i; ni .. nj - 1) ret._strides[i] = ret._lengths[i + 1] * ret._strides[i + 1]; assert((oi == slice.N) == (ni == ret.N)); } @@ -964,7 +964,7 @@ auto byElement(size_t N, Range)(auto ref Slice!(N, Range) slice) private void popFrontImpl() { - foreach_reverse(i; Iota!(0, N)) with (_slice) + foreach_reverse (i; Iota!(0, N)) with (_slice) { _ptr += _strides[i]; _indexes[i]++; @@ -1007,7 +1007,7 @@ auto byElement(size_t N, Range)(auto ref Slice!(N, Range) slice) //calculates shift and new indexes sizediff_t _shift; n += _indexes[N-1]; - foreach_reverse(i; Iota!(1, N)) with (_slice) + foreach_reverse (i; Iota!(1, N)) with (_slice) { immutable v = n / _lengths[i]; n %= _lengths[i]; @@ -1045,7 +1045,7 @@ auto byElement(size_t N, Range)(auto ref Slice!(N, Range) slice) { sizediff_t _shift; n += _indexes[N-1]; - foreach_reverse(i; Iota!(1, N)) with (_slice) + foreach_reverse (i; Iota!(1, N)) with (_slice) { immutable v = n / _lengths[i]; n %= _lengths[i]; @@ -1455,7 +1455,7 @@ auto byElementInStandardSimplex(size_t N, Range)(auto ref Slice!(N, Range) slice private void popFrontImpl() { - foreach_reverse(i; Iota!(0, N)) with (_slice) + foreach_reverse (i; Iota!(0, N)) with (_slice) { _ptr += _strides[i]; _indexes[i]++; @@ -1634,7 +1634,7 @@ template IndexSlice(size_t N) { pragma(inline, true); size_t[N] indexes = void; - foreach_reverse(i; Iota!(0, N - 1)) + foreach_reverse (i; Iota!(0, N - 1)) { indexes[i + 1] = index % _lengths[i]; index /= _lengths[i]; diff --git a/std/experimental/ndslice/slice.d b/std/experimental/ndslice/slice.d index 350ab9ebd3b..1a042d83a8b 100644 --- a/std/experimental/ndslice/slice.d +++ b/std/experimental/ndslice/slice.d @@ -124,7 +124,7 @@ body ret._strides[N - 1] = 1; else ret._strides[N - 1] = range._strides[0]; - foreach_reverse(i; Iota!(0, N - 1)) + foreach_reverse (i; Iota!(0, N - 1)) { ret._lengths[i] = lengths[i]; ret._strides[i] = ret._strides[i + 1] * ret._lengths[i + 1]; @@ -731,7 +731,7 @@ auto makeNdarray(T, Allocator, size_t N, Range)(auto ref Allocator alloc, Slice { alias E = typeof(makeNdarray!T(alloc, slice[0])); auto ret = makeArray!E(alloc, slice.length); - foreach(i, ref e; ret) + foreach (i, ref e; ret) e = .makeNdarray!T(alloc, slice[i]); return ret; } @@ -752,7 +752,7 @@ auto makeNdarray(T, Allocator, size_t N, Range)(auto ref Allocator alloc, Slice static immutable ar = [[0L, 1, 2, 3], [4L, 5, 6, 7], [8L, 9, 10, 11]]; assert(m == ar); - foreach(ref row; m) + foreach (ref row; m) Mallocator.instance.dispose(row); Mallocator.instance.dispose(m); } @@ -1623,7 +1623,7 @@ struct Slice(size_t _N, _Range) { if (this.length != rarrary.length) return false; - foreach(i, ref e; rarrary) + foreach (i, ref e; rarrary) if (e != this[i]) return false; return true; diff --git a/std/experimental/typecons.d b/std/experimental/typecons.d index aee9dc810e6..0c2b5175c50 100644 --- a/std/experimental/typecons.d +++ b/std/experimental/typecons.d @@ -294,7 +294,7 @@ if (Targets.length >= 1 && allSatisfy!(isInterface, Targets)) { string r; bool first = true; - foreach(i; staticIota!(0, num)) + foreach (i; staticIota!(0, num)) { import std.conv : to; r ~= (first ? "" : ", ") ~ " a" ~ (i+1).to!string; @@ -362,7 +362,7 @@ private template wrapperSignature(alias fun) { string r; bool first = true; - foreach(i, p; param) + foreach (i, p; param) { import std.conv : to; r ~= (first ? "" : ", ") ~ p.stringof ~ " a" ~ (i+1).to!string;