Replace 'body' with 'do'

This commit is contained in:
Geod24 2020-01-06 14:59:09 +09:00
parent 490a2519a1
commit bccd494072
5 changed files with 11 additions and 11 deletions

View file

@ -107,11 +107,11 @@ struct Channel(T, size_t buffer_size = 100) {
*/
bool consumeAll(ref FixedRingBuffer!(T, buffer_size) dst)
in { assert(dst.empty); }
body { return m_impl.consumeAll(dst); }
do { return m_impl.consumeAll(dst); }
/// ditto
bool consumeAll(ref FixedRingBuffer!(T, buffer_size) dst) shared
in { assert(dst.empty); }
body { return m_impl.consumeAll(dst); }
do { return m_impl.consumeAll(dst); }
/** Enqueues an element.

View file

@ -505,7 +505,7 @@ private struct IsolatedArray(T)
//assert(isSorted(indices), "Indices must be in ascending order.");
assert(indices[$-1] <= m_array.length, "Splice index out of bounds.");
}
body {
do {
auto ret = new IsolatedArray!T[indices.length];
size_t lidx = 0;
foreach( i, sidx; indices ){
@ -521,7 +521,7 @@ private struct IsolatedArray(T)
assert(array.m_array.ptr == m_array.ptr+m_array.length || array.m_array.ptr+array.length == m_array.ptr,
"Argument to merge() must be a neighbouring array partition.");
}
body {
do {
if( array.m_array.ptr == m_array.ptr + m_array.length ){
m_array = m_array.ptr[0 .. m_array.length + array.length];
} else {

View file

@ -1019,7 +1019,7 @@ nothrow {
*/
@property size_t workerThreadCount()
out(count) { assert(count > 0, "No worker threads started after setupWorkerThreads!?"); }
body {
do {
setupWorkerThreads();
synchronized (st_threadsMutex)
return st_workerPool.threadCount;
@ -1253,7 +1253,7 @@ struct Timer {
*/
void rearm(Duration dur, bool periodic = false) nothrow
in { assert(dur >= 0.seconds, "Negative timer duration specified."); }
body { m_driver.timers.set(m_id, dur, periodic ? dur : 0.seconds); }
do { m_driver.timers.set(m_id, dur, periodic ? dur : 0.seconds); }
/** Resets the timer and avoids any firing.
*/

View file

@ -365,16 +365,16 @@ struct NetworkAddress {
@property inout(sockaddr_in)* sockAddrInet4() inout pure nothrow
in { assert (family == AF_INET); }
body { return &addr_ip4; }
do { return &addr_ip4; }
@property inout(sockaddr_in6)* sockAddrInet6() inout pure nothrow
in { assert (family == AF_INET6); }
body { return &addr_ip6; }
do { return &addr_ip6; }
version (Posix) {
@property inout(sockaddr_un)* sockAddrUnix() inout pure nothrow
in { assert (family == AddressFamily.UNIX); }
body { return &addr_unix; }
do { return &addr_unix; }
}
/** Returns a string representation of the IP address

View file

@ -190,7 +190,7 @@ in {
assert((cast(size_t) chunk.ptr) % T.alignof == 0,
format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", &chunk[0], T.alignof, T.stringof));
} body {
} do {
enum classSize = __traits(classInstanceSize, T);
auto result = () @trusted { return cast(T) chunk.ptr; } ();
@ -226,7 +226,7 @@ in {
assert((cast(size_t) chunk.ptr) % T.alignof == 0,
format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", &chunk[0], T.alignof, T.stringof));
} body {
} do {
return emplace(() @trusted { return cast(T*)chunk.ptr; } (), args);
}