Skip to content

Commit

Permalink
Solved a minor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RazvanN7 committed Dec 6, 2016
1 parent 2e89652 commit ff4b6b9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions std/algorithm/searching.d
Original file line number Diff line number Diff line change
Expand Up @@ -1368,8 +1368,7 @@ if (isInputRange!InputRange &&
static if (is(InputRange : SortedRange!TT, TT) && isDefaultPred)
{
auto lb = haystack.lowerBound(needle);
if ((lb.length == 0 && haystack[0] != needle) || lb.length == haystack.length
|| haystack[lb.length] != needle)
if (lb.length == haystack.length || haystack[lb.length] != needle)
return haystack[$ .. $];

return haystack[lb.length .. $];
Expand Down Expand Up @@ -1850,10 +1849,8 @@ if (isRandomAccessRange!R1 && hasLength!R1 && hasSlicing!R1 && isBidirectionalRa

if (m[1].empty)
return haystack[partitions[0].length + partitions[1].length - count .. $];
if (!m[1].empty)
return haystack[$ .. $];
}
static if (isRandomAccessRange!R2)
else static if (isRandomAccessRange!R2)
{
immutable lastIndex = needleLength - 1;
auto last = needle[lastIndex];
Expand Down

0 comments on commit ff4b6b9

Please sign in to comment.