reduce duplicative code (#16640)

This commit is contained in:
0v0 2024-07-01 16:47:17 +08:00 committed by GitHub
parent 25f26e2bdf
commit 2700b86566
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 5 deletions

View file

@ -186,8 +186,8 @@ unittest
{
bool overflow;
immutable uint r = addu (uint.max - i, uint.max - i, overflow);
assert (r == 2 * (uint.max - i));
assert (overflow);
assert(r == 2 * (uint.max - i));
assert(overflow);
}
bool overflow;

View file

@ -102,7 +102,7 @@ AAShell makeAA(K, V)(V[K] src) @trusted
dim = dim * GROW_FAC;
// used during runtime.
size_t delegate(scope const void *) nothrow hashFn = (scope const void* val) {
typeof(Impl.hashFn) hashFn = (scope const void* val) {
auto x = cast(K*)val;
return hashOf(*x);
};

View file

@ -219,13 +219,12 @@ do
return overflowedError(optname, str);
i++;
break;
}
else // unexpected non-digit character
{
i = 0;
break;
}
break;
}
}