Skip to content

Commit

Permalink
Issue 8829 - std.algorithm.find fails to take advantage of SortedRange
Browse files Browse the repository at this point in the history
  • Loading branch information
RazvanN7 committed Dec 6, 2016
1 parent 818d512 commit 752b2ca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions std/algorithm/searching.d
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 752b2ca

Please sign in to comment.