mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 07:00:37 +03:00
Slight tweak to static if in find.
The semantics are the same. It's just less redundant this way.
This commit is contained in:
parent
47204076d8
commit
6eba82fb56
1 changed files with 3 additions and 3 deletions
|
@ -3216,7 +3216,7 @@ if (isRandomAccessRange!R1 && isForwardRange!R2 && !isBidirectionalRange!R2 &&
|
|||
|
||||
haystack = .find!pred(haystack, needle.front);
|
||||
|
||||
static if (hasLength!R1 && hasLength!R2 && is(typeof(takeNone(haystack)) == typeof(haystack)))
|
||||
static if (hasLength!R1 && hasLength!R2 && is(typeof(takeNone(haystack)) == R1))
|
||||
{
|
||||
if (needle.length > haystack.length)
|
||||
return takeNone(haystack);
|
||||
|
@ -3240,9 +3240,9 @@ if (isRandomAccessRange!R1 && isForwardRange!R2 && !isBidirectionalRange!R2 &&
|
|||
if (needle.empty || haystack.empty)
|
||||
return haystack;
|
||||
|
||||
static if(hasLength!R1 && is(typeof(takeNone(haystack)) == typeof(haystack)))
|
||||
static if (hasLength!R1 && is(typeof(takeNone(haystack)) == R1))
|
||||
{
|
||||
if(matchLen == haystack.length)
|
||||
if (matchLen == haystack.length)
|
||||
return takeNone(haystack);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue