Skip to content

Commit

Permalink
Merge pull request #159 from kubo39/replace-body-with-do
Browse files Browse the repository at this point in the history
Replace body with do
merged-on-behalf-of: Petar Kirov <[email protected]>
  • Loading branch information
dlang-bot authored May 6, 2020
2 parents cc6fe5e + ec8ff7a commit 8cdffc8
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/containers/cyclicbuffer.d
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct CyclicBuffer(T, Allocator = Mallocator, bool supportGC = shouldAddGCRange
{
assert(allocator !is null, "Allocator must not be null");
}
body
do
{
this.allocator = allocator;
}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/dynamicarray.d
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct DynamicArray(T, Allocator = Mallocator, bool supportGC = shouldAddGCRange
{
assert(allocator !is null, "Allocator must not be null");
}
body
do
{
this.allocator = allocator;
}
Expand Down
10 changes: 5 additions & 5 deletions src/containers/hashmap.d
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct HashMap(K, V, Allocator = Mallocator, alias hashFunction = generateHash!K
{
assert(allocator !is null, "Allocator must not be null");
}
body
do
{
this.allocator = allocator;
}
Expand All @@ -57,7 +57,7 @@ struct HashMap(K, V, Allocator = Mallocator, alias hashFunction = generateHash!K
assert(allocator !is null, "Allocator must not be null");
assert((bucketCount & (bucketCount - 1)) == 0, "bucketCount must be a power of two");
}
body
do
{
this.allocator = allocator;
initialize(bucketCount);
Expand All @@ -79,7 +79,7 @@ struct HashMap(K, V, Allocator = Mallocator, alias hashFunction = generateHash!K
{
assert((bucketCount & (bucketCount - 1)) == 0, "bucketCount must be a power of two");
}
body
do
{
initialize(bucketCount);
}
Expand Down Expand Up @@ -251,7 +251,7 @@ struct HashMap(K, V, Allocator = Mallocator, alias hashFunction = generateHash!K
{
assert (result.length == _length);
}
body
do
{
import std.array : appender;
auto app = appender!(K[])();
Expand Down Expand Up @@ -283,7 +283,7 @@ struct HashMap(K, V, Allocator = Mallocator, alias hashFunction = generateHash!K
{
assert (result.length == _length);
}
body
do
{
import std.array : appender;
auto app = appender!(ContainerElementType!(This, V)[])();
Expand Down
6 changes: 3 additions & 3 deletions src/containers/hashset.d
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct HashSet(T, Allocator = Mallocator, alias hashFunction = generateHash!T,
{
assert(allocator !is null, "Allocator must not be null");
}
body
do
{
this.allocator = allocator;
}
Expand All @@ -56,7 +56,7 @@ struct HashSet(T, Allocator = Mallocator, alias hashFunction = generateHash!T,
assert(allocator !is null, "Allocator must not be null");
assert ((bucketCount & (bucketCount - 1)) == 0, "bucketCount must be a power of two");
}
body
do
{
this.allocator = allocator;
initialize(bucketCount);
Expand All @@ -73,7 +73,7 @@ struct HashSet(T, Allocator = Mallocator, alias hashFunction = generateHash!T,
{
assert ((bucketCount & (bucketCount - 1)) == 0, "bucketCount must be a power of two");
}
body
do
{
initialize(bucketCount);
}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/immutablehashset.d
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct ImmutableHashSet(T, alias hashFunction)
import std.array : array;
assert (values.dup.sort().uniq().array().length == values.length);
}
body
do
{
empty = values.length == 0;
length = values.length;
Expand Down
6 changes: 3 additions & 3 deletions src/containers/openhashset.d
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct OpenHashSet(T, Allocator = Mallocator,
{
assert(allocator !is null, "Allocator must not be null");
}
body
do
{
this.allocator = allocator;
}
Expand All @@ -59,7 +59,7 @@ struct OpenHashSet(T, Allocator = Mallocator,
assert(allocator !is null, "Allocator must not be null");
assert ((initialCapacity & initialCapacity - 1) == 0, "initialCapacity must be a power of 2");
}
body
do
{
this.allocator = allocator;
initialize(initialCapacity);
Expand All @@ -78,7 +78,7 @@ struct OpenHashSet(T, Allocator = Mallocator,
{
assert ((initialCapacity & initialCapacity - 1) == 0, "initialCapacity must be a power of 2");
}
body
do
{
initialize(initialCapacity);
}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/simdset.d
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ version (D_InlineAsm_X86_64) struct SimdSet(T, Allocator = Mallocator)
{
assert(allocator !is null, "Allocator must not be null");
}
body
do
{
this.allocator = allocator;
}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/slist.d
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct SList(T, Allocator = Mallocator, bool supportGC = shouldAddGCRange!T)
{
assert(allocator !is null, "Allocator must not be null");
}
body
do
{
this.allocator = allocator;
}
Expand Down
14 changes: 7 additions & 7 deletions src/containers/ttree.d
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct TTree(T, Allocator = Mallocator, bool allowDuplicates = false,
{
assert(allocator !is null, "Allocator must not be null");
}
body
do
{
this.allocator = allocator;
}
Expand Down Expand Up @@ -429,7 +429,7 @@ struct TTree(T, Allocator = Mallocator, bool allowDuplicates = false,
{
assert (!empty);
}
body
do
{
index++;
if (index >= nodeCapacity || current.isFree(index))
Expand Down Expand Up @@ -530,7 +530,7 @@ private:
assert (result.left is null);
assert (result.right is null);
}
body
do
{
import core.memory : GC;
import stdx.allocator : make;
Expand All @@ -552,7 +552,7 @@ private:
{
assert (n !is null);
}
body
do
{
import stdx.allocator : dispose;
import core.memory : GC;
Expand Down Expand Up @@ -656,7 +656,7 @@ private:
static if (isPointer!T || is (T == class) || is (T == interface))
assert (value !is null);
}
body
do
{
import std.algorithm : sort;
import std.range : assumeSorted;
Expand Down Expand Up @@ -834,7 +834,7 @@ private:
{
assert (!isEmpty());
}
body
do
{
if (left is null && right is null)
{
Expand Down Expand Up @@ -872,7 +872,7 @@ private:
static if (isPointer!T || is (T == class) || is(T == interface))
assert (result !is null);
}
body
do
{
if (left is null && right is null)
{
Expand Down
12 changes: 6 additions & 6 deletions src/containers/unrolledlist.d
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct UnrolledList(T, Allocator = Mallocator,
{
assert(allocator !is null);
}
body
do
{
this.allocator = allocator;
}
Expand Down Expand Up @@ -254,7 +254,7 @@ struct UnrolledList(T, Allocator = Mallocator,
assert (!empty());
assert (_front.registry != 0);
}
body
do
{
version (LDC_64)
{
Expand Down Expand Up @@ -312,7 +312,7 @@ struct UnrolledList(T, Allocator = Mallocator,
assert (!empty);
assert (_front.registry != 0);
}
body
do
{
version (LDC_64)
{
Expand All @@ -339,7 +339,7 @@ struct UnrolledList(T, Allocator = Mallocator,
assert (!empty);
assert (!_back.empty);
}
body
do
{
size_t i = nodeCapacity - 1;
while (_back.isFree(i))
Expand All @@ -360,7 +360,7 @@ struct UnrolledList(T, Allocator = Mallocator,
assert (!empty);
assert (!_back.empty);
}
body
do
{
size_t i = nodeCapacity - 1;
while (_back.isFree(i))
Expand Down Expand Up @@ -544,7 +544,7 @@ private:
assert (second !is null);
assert (second is first.next);
}
body
do
{
size_t i;
ContainerStorageType!T[nodeCapacity] temp;
Expand Down

0 comments on commit 8cdffc8

Please sign in to comment.