mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 06:00:35 +03:00
Merge pull request #8079 from nordlow/fix-pure-scope-searching
Annotate std/algorithm/searching.d to please dlang/dmd#12520 merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
This commit is contained in:
commit
a01c94531e
1 changed files with 3 additions and 2 deletions
|
@ -1601,7 +1601,8 @@ if (isInputRange!InputRange &&
|
|||
{
|
||||
if (!__ctfe && canSearchInCodeUnits!char(needle))
|
||||
{
|
||||
static R trustedMemchr(ref R haystack, ref E needle) @trusted nothrow pure
|
||||
static inout(R) trustedMemchr(ref return scope inout(R) haystack,
|
||||
ref const scope E needle) @trusted nothrow pure
|
||||
{
|
||||
import core.stdc.string : memchr;
|
||||
auto ptr = memchr(haystack.ptr, needle, haystack.length);
|
||||
|
@ -1665,7 +1666,7 @@ if (isInputRange!InputRange &&
|
|||
{
|
||||
import std.algorithm.comparison : max, min;
|
||||
|
||||
R findHelper(ref R haystack, ref E needle) @trusted nothrow pure
|
||||
R findHelper(return scope ref R haystack, ref E needle) @trusted nothrow pure
|
||||
{
|
||||
import core.stdc.string : memchr;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue