Skip to content

Commit 1630170

Browse files
authored
Merge pull request #4771 from WalterBright/conv-scope
std.conv: add annotations
2 parents e9cca34 + 74ac8f9 commit 1630170

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

std/conv.d

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3923,7 +3923,7 @@ template octal(alias decimalInteger)
39233923
Takes a string, num, which is an octal literal, and returns its
39243924
value, in the type T specified.
39253925
*/
3926-
private T octal(T)(string num)
3926+
private T octal(T)(const string num)
39273927
{
39283928
assert(isOctalLiteral(num));
39293929

@@ -4001,7 +4001,8 @@ Returns if the given string is a correctly formatted octal literal.
40014001
The format is specified in spec/lex.html. The leading zero is allowed, but
40024002
not required.
40034003
*/
4004-
private bool isOctalLiteral(string num)
4004+
@safe pure nothrow @nogc
4005+
private bool isOctalLiteral(const string num)
40054006
{
40064007
if (num.length == 0)
40074008
return false;
@@ -5593,7 +5594,8 @@ The result is true if and only if the input string is composed of whitespace
55935594
characters (\f\n\r\t\v lineSep paraSep nelSep) and
55945595
an even number of hexadecimal digits (regardless of the case).
55955596
*/
5596-
private bool isHexLiteral(String)(in String hexData)
5597+
@safe pure @nogc
5598+
private bool isHexLiteral(String)(scope const String hexData)
55975599
{
55985600
import std.ascii : isHexDigit;
55995601
import std.uni : lineSep, paraSep, nelSep;
@@ -5738,7 +5740,7 @@ if (hexData.isHexLiteral)
57385740
C is granted to be a valid char type by the caller.
57395741
*/
57405742
@safe nothrow pure
5741-
private auto hexStrImpl(String)(String hexData)
5743+
private auto hexStrImpl(String)(scope String hexData)
57425744
{
57435745
import std.ascii;
57445746
alias C = Unqual!(ElementEncodingType!String);

0 commit comments

Comments
 (0)