mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 15:10:46 +03:00
Change foreach loop in std.algorithm.searching.find to a for-loop
This commit is contained in:
parent
449ff95df6
commit
e6b0b458cc
1 changed files with 2 additions and 2 deletions
|
@ -1489,9 +1489,9 @@ if (isInputRange!InputRange)
|
||||||
else static if (!isInfinite!R && hasSlicing!R && is(typeof(haystack[cast(size_t)0 .. $])))
|
else static if (!isInfinite!R && hasSlicing!R && is(typeof(haystack[cast(size_t)0 .. $])))
|
||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
foreach (ref e; haystack)
|
for (auto h = haystack.save; !h.empty; h.popFront())
|
||||||
{
|
{
|
||||||
if (predFun(e))
|
if (predFun(h.front))
|
||||||
return haystack[i .. $];
|
return haystack[i .. $];
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue