mirror of
https://github.com/dlang/phobos.git
synced 2025-05-08 03:56:54 +03:00
update array.d scope import
This commit is contained in:
parent
c7e3c0f025
commit
fd82dfe87f
1 changed files with 1 additions and 1 deletions
|
@ -816,7 +816,6 @@ slice, returns that slice. Otherwise, returns the null slice.
|
||||||
*/
|
*/
|
||||||
inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2) @trusted pure nothrow
|
inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2) @trusted pure nothrow
|
||||||
{
|
{
|
||||||
import std.algorithm : min, max;
|
|
||||||
alias U = inout(T);
|
alias U = inout(T);
|
||||||
static U* max(U* a, U* b) nothrow { return a > b ? a : b; }
|
static U* max(U* a, U* b) nothrow { return a > b ? a : b; }
|
||||||
static U* min(U* a, U* b) nothrow { return a < b ? a : b; }
|
static U* min(U* a, U* b) nothrow { return a < b ? a : b; }
|
||||||
|
@ -2717,6 +2716,7 @@ unittest
|
||||||
//ret sugLen: A suggested growth.
|
//ret sugLen: A suggested growth.
|
||||||
private size_t appenderNewCapacity(size_t TSizeOf)(size_t curLen, size_t reqLen) @safe pure nothrow
|
private size_t appenderNewCapacity(size_t TSizeOf)(size_t curLen, size_t reqLen) @safe pure nothrow
|
||||||
{
|
{
|
||||||
|
import std.algorithm : max;
|
||||||
if(curLen == 0)
|
if(curLen == 0)
|
||||||
return max(reqLen,8);
|
return max(reqLen,8);
|
||||||
ulong mult = 100 + (1000UL) / (bsr(curLen * TSizeOf) + 1);
|
ulong mult = 100 + (1000UL) / (bsr(curLen * TSizeOf) + 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue