mirror of
https://github.com/dlang/phobos.git
synced 2025-05-03 08:30:33 +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
|
||||
// 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue