Issue 8829 - std.algorithm.find fails to take advantage of SortedRange

This commit is contained in:
RazvanN7 2016-11-17 12:49:49 +02:00
parent 8b29f206ae
commit d6519853e1

View file

@ -1857,7 +1857,7 @@ if (isRandomAccessRange!R1 && hasLength!R1 && hasSlicing!R1 && isBidirectionalRa
if(needle.empty())
return haystack[partitions[0].length + partitions[1].length - count .. $];
}
else if (isRandomAccessRange!R2)
static if (isRandomAccessRange!R2)
{
immutable lastIndex = needleLength - 1;
auto last = needle[lastIndex];