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

This commit is contained in:
RazvanN7 2016-11-17 15:08:06 +02:00
parent 818d512007
commit 752b2ca210

View file

@ -1818,6 +1818,7 @@ if (isRandomAccessRange!R1 && hasLength!R1 && hasSlicing!R1 && isBidirectionalRa
// Binary search can be used to find the first occurence
// of the first element of the needle in haystack.
// When it is found O(walklength(needle)) steps are performed.
// 8829 enhancement
import std.range;
static if(is(typeof(haystack) == typeof(needle))
&& is(typeof(haystack) : SortedRange!TT, TT)