moved import std.utf : canSearchInCodeUnits; in std.algorithm.find

This commit is contained in:
Rainer Schuetze 2014-01-03 22:10:25 +01:00
parent d2cdbe3ce5
commit 60cf6a5577

View file

@ -3968,13 +3968,13 @@ if (isInputRange!InputRange &&
//These are two special cases which can search without decoding the UTF stream.
static if (isDefaultPred && isIntegralNeedle)
{
import std.utf : canSearchInCodeUnits;
//This special case deals with UTF8 search, when the needle
//is represented by a single code point.
//Note: "needle <= 0x7F" properly handles sign via unsigned promotion
static if (is(UEEType == char))
{
import std.utf : canSearchInCodeUnits;
if (!__ctfe && canSearchInCodeUnits!char(needle))
{
static R trustedMemchr(ref R haystack, ref E needle) @trusted nothrow pure