Merge remote-tracking branch 'upstream/stable' into merge_stable

This commit is contained in:
Iain Buclaw 2023-07-02 02:10:20 +00:00
commit a3526d11dd
2 changed files with 18 additions and 2 deletions

View file

@ -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
static if (__traits(isSame, map, a => a))
{
// direct access via a random access range is faster
static if (isRandomAccessRange!Range)
{
@ -3865,6 +3864,14 @@ if (isInputRange!Range && !isInfinite!Range &&
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
/**
Computes a subrange of `range` starting at the first occurrence of `range`'s