mirror of
https://github.com/dlang/phobos.git
synced 2025-05-09 13:02:30 +03:00
Merge remote-tracking branch 'upstream/stable' into merge_stable
This commit is contained in:
commit
a3526d11dd
2 changed files with 18 additions and 2 deletions
|
@ -1342,7 +1342,6 @@ if (isInputRange!Range && !isInfinite!Range &&
|
||||||
// if we only have one statement in the loop, it can be optimized a lot better
|
// if we only have one statement in the loop, it can be optimized a lot better
|
||||||
static if (__traits(isSame, map, a => a))
|
static if (__traits(isSame, map, a => a))
|
||||||
{
|
{
|
||||||
|
|
||||||
// direct access via a random access range is faster
|
// direct access via a random access range is faster
|
||||||
static if (isRandomAccessRange!Range)
|
static if (isRandomAccessRange!Range)
|
||||||
{
|
{
|
||||||
|
@ -3865,6 +3864,14 @@ if (isInputRange!Range && !isInfinite!Range &&
|
||||||
assert(arr.maxElement!"a.val".val == 1);
|
assert(arr.maxElement!"a.val".val == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://issues.dlang.org/show_bug.cgi?id=23993
|
||||||
|
@safe unittest
|
||||||
|
{
|
||||||
|
import std.bigint : BigInt;
|
||||||
|
|
||||||
|
assert([BigInt(2), BigInt(3)].maxElement == BigInt(3));
|
||||||
|
}
|
||||||
|
|
||||||
// minPos
|
// minPos
|
||||||
/**
|
/**
|
||||||
Computes a subrange of `range` starting at the first occurrence of `range`'s
|
Computes a subrange of `range` starting at the first occurrence of `range`'s
|
||||||
|
|
|
@ -9142,7 +9142,7 @@ public:
|
||||||
{
|
{
|
||||||
static if (needsEndTracker)
|
static if (needsEndTracker)
|
||||||
{
|
{
|
||||||
if (poppedElems < windowSize)
|
if (nextSource.empty)
|
||||||
hasShownPartialBefore = true;
|
hasShownPartialBefore = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -10122,6 +10122,15 @@ public:
|
||||||
assert("ab cd".splitter(' ').slide!(No.withPartial)(2).equal!equal([["ab", "cd"]]));
|
assert("ab cd".splitter(' ').slide!(No.withPartial)(2).equal!equal([["ab", "cd"]]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://issues.dlang.org/show_bug.cgi?id=23976
|
||||||
|
@safe unittest
|
||||||
|
{
|
||||||
|
import std.algorithm.comparison : equal;
|
||||||
|
import std.algorithm.iteration : splitter;
|
||||||
|
|
||||||
|
assert("1<2".splitter('<').slide(2).equal!equal([["1", "2"]]));
|
||||||
|
}
|
||||||
|
|
||||||
private struct OnlyResult(Values...)
|
private struct OnlyResult(Values...)
|
||||||
if (Values.length > 1)
|
if (Values.length > 1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue