mirror of
https://github.com/dlang/phobos.git
synced 2025-05-06 02:45:12 +03:00
Issue 8829 - std.algorithm.find fails to take advantage of SortedRange
This commit is contained in:
parent
818d512007
commit
752b2ca210
1 changed files with 1 additions and 0 deletions
|
@ -1818,6 +1818,7 @@ if (isRandomAccessRange!R1 && hasLength!R1 && hasSlicing!R1 && isBidirectionalRa
|
||||||
// Binary search can be used to find the first occurence
|
// Binary search can be used to find the first occurence
|
||||||
// of the first element of the needle in haystack.
|
// of the first element of the needle in haystack.
|
||||||
// When it is found O(walklength(needle)) steps are performed.
|
// When it is found O(walklength(needle)) steps are performed.
|
||||||
|
// 8829 enhancement
|
||||||
import std.range;
|
import std.range;
|
||||||
static if(is(typeof(haystack) == typeof(needle))
|
static if(is(typeof(haystack) == typeof(needle))
|
||||||
&& is(typeof(haystack) : SortedRange!TT, TT)
|
&& is(typeof(haystack) : SortedRange!TT, TT)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue