Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions std/experimental/allocator/gc_allocator.d
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion std/experimental/allocator/mallocator.d
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions std/experimental/ndslice/internal.d
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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));
Expand Down
12 changes: 6 additions & 6 deletions std/experimental/ndslice/selection.d
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down Expand Up @@ -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]++;
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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]++;
Expand Down Expand Up @@ -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];
Expand Down
8 changes: 4 additions & 4 deletions std/experimental/ndslice/slice.d
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions std/experimental/typecons.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down