mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 23:20:29 +03:00
moved import std.utf : canSearchInCodeUnits; in std.algorithm.find
This commit is contained in:
parent
d2cdbe3ce5
commit
60cf6a5577
1 changed files with 2 additions and 2 deletions
|
@ -3968,13 +3968,13 @@ if (isInputRange!InputRange &&
|
||||||
//These are two special cases which can search without decoding the UTF stream.
|
//These are two special cases which can search without decoding the UTF stream.
|
||||||
static if (isDefaultPred && isIntegralNeedle)
|
static if (isDefaultPred && isIntegralNeedle)
|
||||||
{
|
{
|
||||||
|
import std.utf : canSearchInCodeUnits;
|
||||||
|
|
||||||
//This special case deals with UTF8 search, when the needle
|
//This special case deals with UTF8 search, when the needle
|
||||||
//is represented by a single code point.
|
//is represented by a single code point.
|
||||||
//Note: "needle <= 0x7F" properly handles sign via unsigned promotion
|
//Note: "needle <= 0x7F" properly handles sign via unsigned promotion
|
||||||
static if (is(UEEType == char))
|
static if (is(UEEType == char))
|
||||||
{
|
{
|
||||||
import std.utf : canSearchInCodeUnits;
|
|
||||||
|
|
||||||
if (!__ctfe && canSearchInCodeUnits!char(needle))
|
if (!__ctfe && canSearchInCodeUnits!char(needle))
|
||||||
{
|
{
|
||||||
static R trustedMemchr(ref R haystack, ref E needle) @trusted nothrow pure
|
static R trustedMemchr(ref R haystack, ref E needle) @trusted nothrow pure
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue