mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 05:30:33 +03:00
rename variables
This commit is contained in:
parent
452b1def78
commit
8293310cd8
7 changed files with 24 additions and 24 deletions
|
@ -630,36 +630,36 @@ if (isIntegral!T || is(T == Checked!(U, H), U, H))
|
||||||
import core.atomic : atomicLoad, MemoryOrder;
|
import core.atomic : atomicLoad, MemoryOrder;
|
||||||
static if (is(typeof(this.payload.atomicLoad!(MemoryOrder.acq)) P))
|
static if (is(typeof(this.payload.atomicLoad!(MemoryOrder.acq)) P))
|
||||||
{
|
{
|
||||||
auto local_payload = __ctfe ? cast(P) this.payload
|
auto localPayload = __ctfe ? cast(P) this.payload
|
||||||
: this.payload.atomicLoad!(MemoryOrder.acq);
|
: this.payload.atomicLoad!(MemoryOrder.acq);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
alias local_payload = this.payload;
|
alias localPayload = this.payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
static if (hasMember!(Hook, "hookToHash"))
|
static if (hasMember!(Hook, "hookToHash"))
|
||||||
{
|
{
|
||||||
return hook.hookToHash(local_payload);
|
return hook.hookToHash(localPayload);
|
||||||
}
|
}
|
||||||
else static if (stateSize!Hook > 0)
|
else static if (stateSize!Hook > 0)
|
||||||
{
|
{
|
||||||
static if (hasMember!(typeof(local_payload), "toHash"))
|
static if (hasMember!(typeof(localPayload), "toHash"))
|
||||||
{
|
{
|
||||||
return local_payload.toHash() ^ hashOf(hook);
|
return localPayload.toHash() ^ hashOf(hook);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return hashOf(local_payload) ^ hashOf(hook);
|
return hashOf(localPayload) ^ hashOf(hook);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else static if (hasMember!(typeof(local_payload), "toHash"))
|
else static if (hasMember!(typeof(localPayload), "toHash"))
|
||||||
{
|
{
|
||||||
return local_payload.toHash();
|
return localPayload.toHash();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return .hashOf(local_payload);
|
return .hashOf(localPayload);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10095,7 +10095,7 @@ else version (Windows)
|
||||||
|
|
||||||
static void testScope(scope ref SysTime st) @safe
|
static void testScope(scope ref SysTime st) @safe
|
||||||
{
|
{
|
||||||
auto local_result = SysTimeToSYSTEMTIME(st);
|
auto localResult = SysTimeToSYSTEMTIME(st);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -202,14 +202,14 @@ if (hashBlockSize % 8 == 0)
|
||||||
import std.string : representation;
|
import std.string : representation;
|
||||||
string data1 = "Hello, world", data2 = "Hola mundo";
|
string data1 = "Hello, world", data2 = "Hola mundo";
|
||||||
auto hmac = HMAC!SHA1("My s3cR3T keY".representation);
|
auto hmac = HMAC!SHA1("My s3cR3T keY".representation);
|
||||||
auto digestTest = hmac.put(data1.representation)
|
auto testDigest = hmac.put(data1.representation)
|
||||||
.put(data2.representation)
|
.put(data2.representation)
|
||||||
.finish();
|
.finish();
|
||||||
static immutable expected = [
|
static immutable expected = [
|
||||||
197, 57, 52, 3, 13, 194, 13,
|
197, 57, 52, 3, 13, 194, 13,
|
||||||
36, 117, 228, 8, 11, 111, 51,
|
36, 117, 228, 8, 11, 111, 51,
|
||||||
165, 3, 123, 31, 251, 113];
|
165, 3, 123, 31, 251, 113];
|
||||||
assert(digestTest == expected);
|
assert(testDigest == expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3148,7 +3148,7 @@ if (isPointer!T && !is(T == enum) && !hasToString!(T, Char))
|
||||||
|
|
||||||
auto a = iota(0, 10);
|
auto a = iota(0, 10);
|
||||||
auto b = iota(0, 10);
|
auto b = iota(0, 10);
|
||||||
auto p = () @trusted { auto scoped_p = &a; return scoped_p; }();
|
auto p = () @trusted { auto result = &a; return result; }();
|
||||||
|
|
||||||
assert(format("%s",p) != format("%s",b));
|
assert(format("%s",p) != format("%s",b));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2646,17 +2646,17 @@ private:
|
||||||
|
|
||||||
enum msecs = 1000;
|
enum msecs = 1000;
|
||||||
auto pair = socketPair();
|
auto pair = socketPair();
|
||||||
auto sockTest = pair[0];
|
auto testSock = pair[0];
|
||||||
sockTest.setOption(SocketOptionLevel.SOCKET,
|
testSock.setOption(SocketOptionLevel.SOCKET,
|
||||||
SocketOption.RCVTIMEO, dur!"msecs"(msecs));
|
SocketOption.RCVTIMEO, dur!"msecs"(msecs));
|
||||||
|
|
||||||
auto sw = StopWatch(Yes.autoStart);
|
auto sw = StopWatch(Yes.autoStart);
|
||||||
ubyte[1] buf;
|
ubyte[1] buf;
|
||||||
sockTest.receive(buf);
|
testSock.receive(buf);
|
||||||
sw.stop();
|
sw.stop();
|
||||||
|
|
||||||
Duration readBack = void;
|
Duration readBack = void;
|
||||||
sockTest.getOption(SocketOptionLevel.SOCKET, SocketOption.RCVTIMEO, readBack);
|
testSock.getOption(SocketOptionLevel.SOCKET, SocketOption.RCVTIMEO, readBack);
|
||||||
|
|
||||||
assert(readBack.total!"msecs" == msecs);
|
assert(readBack.total!"msecs" == msecs);
|
||||||
assert(sw.peek().total!"msecs" > msecs - 100 && sw.peek().total!"msecs" < msecs + 100);
|
assert(sw.peek().total!"msecs" > msecs - 100 && sw.peek().total!"msecs" < msecs + 100);
|
||||||
|
|
|
@ -1952,10 +1952,10 @@ private template matchImpl(Flag!"exhaustive" exhaustive, handlers...)
|
||||||
// An array that maps caseIds to handler indices ("hids").
|
// An array that maps caseIds to handler indices ("hids").
|
||||||
enum matches = ()
|
enum matches = ()
|
||||||
{
|
{
|
||||||
size_t[numCases] scoped_matches;
|
size_t[numCases] result;
|
||||||
|
|
||||||
// Workaround for https://issues.dlang.org/show_bug.cgi?id=19561
|
// Workaround for https://issues.dlang.org/show_bug.cgi?id=19561
|
||||||
foreach (ref match; scoped_matches)
|
foreach (ref match; result)
|
||||||
{
|
{
|
||||||
match = noMatch;
|
match = noMatch;
|
||||||
}
|
}
|
||||||
|
@ -1966,15 +1966,15 @@ private template matchImpl(Flag!"exhaustive" exhaustive, handlers...)
|
||||||
{
|
{
|
||||||
static if (canMatch!(handler, valueTypes!caseId))
|
static if (canMatch!(handler, valueTypes!caseId))
|
||||||
{
|
{
|
||||||
if (scoped_matches[caseId] == noMatch)
|
if (result[caseId] == noMatch)
|
||||||
{
|
{
|
||||||
scoped_matches[caseId] = hid;
|
result[caseId] = hid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return scoped_matches;
|
return result;
|
||||||
}();
|
}();
|
||||||
|
|
||||||
import std.algorithm.searching : canFind;
|
import std.algorithm.searching : canFind;
|
||||||
|
|
|
@ -6271,8 +6271,8 @@ struct UnicodeSetParser(Range)
|
||||||
{
|
{
|
||||||
if (casefold_)
|
if (casefold_)
|
||||||
{
|
{
|
||||||
auto local_range = simpleCaseFoldings(ch);
|
auto foldings = simpleCaseFoldings(ch);
|
||||||
foreach (v; local_range)
|
foreach (v; foldings)
|
||||||
set |= v;
|
set |= v;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue