Skip to content

Commit e22a854

Browse files
nordlowthewilsonator
authored andcommitted
Inline trivial functions in std.ascii
1 parent f2e5acc commit e22a854

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

std/ascii.d

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ else
186186
Params: c = The character to test.
187187
Returns: Whether `c` is a letter or a number (0 .. 9, a .. z, A .. Z).
188188
+/
189+
pragma(inline, true)
189190
bool isAlphaNum(dchar c) @safe pure nothrow @nogc
190191
{
191192
const hc = c | 0x20;
@@ -218,6 +219,7 @@ bool isAlphaNum(dchar c) @safe pure nothrow @nogc
218219
Params: c = The character to test.
219220
Returns: Whether `c` is an ASCII letter (A .. Z, a .. z).
220221
+/
222+
pragma(inline, true)
221223
bool isAlpha(dchar c) @safe pure nothrow @nogc
222224
{
223225
// Optimizer can turn this into a bitmask operation on 64 bit code
@@ -250,6 +252,7 @@ bool isAlpha(dchar c) @safe pure nothrow @nogc
250252
Params: c = The character to test.
251253
Returns: Whether `c` is a lowercase ASCII letter (a .. z).
252254
+/
255+
pragma(inline, true)
253256
bool isLower(dchar c) @safe pure nothrow @nogc
254257
{
255258
return c >= 'a' && c <= 'z';
@@ -282,6 +285,7 @@ bool isLower(dchar c) @safe pure nothrow @nogc
282285
Params: c = The character to test.
283286
Returns: Whether `c` is an uppercase ASCII letter (A .. Z).
284287
+/
288+
pragma(inline, true)
285289
bool isUpper(dchar c) @safe pure nothrow @nogc
286290
{
287291
return c <= 'Z' && 'A' <= c;
@@ -314,6 +318,7 @@ bool isUpper(dchar c) @safe pure nothrow @nogc
314318
Params: c = The character to test.
315319
Returns: Whether `c` is a digit (0 .. 9).
316320
+/
321+
pragma(inline, true)
317322
bool isDigit(dchar c) @safe pure nothrow @nogc
318323
{
319324
return '0' <= c && c <= '9';
@@ -347,6 +352,7 @@ bool isDigit(dchar c) @safe pure nothrow @nogc
347352
Params: c = The character to test.
348353
Returns: Whether `c` is a digit in base 8 (0 .. 7).
349354
+/
355+
pragma(inline, true)
350356
bool isOctalDigit(dchar c) @safe pure nothrow @nogc
351357
{
352358
return c >= '0' && c <= '7';
@@ -377,6 +383,7 @@ bool isOctalDigit(dchar c) @safe pure nothrow @nogc
377383
Params: c = The character to test.
378384
Returns: Whether `c` is a digit in base 16 (0 .. 9, A .. F, a .. f).
379385
+/
386+
pragma(inline, true)
380387
bool isHexDigit(dchar c) @safe pure nothrow @nogc
381388
{
382389
const hc = c | 0x20;
@@ -411,6 +418,7 @@ bool isHexDigit(dchar c) @safe pure nothrow @nogc
411418
space, tab, vertical tab, form feed, carriage return, and linefeed
412419
characters.
413420
+/
421+
pragma(inline, true)
414422
bool isWhite(dchar c) @safe pure nothrow @nogc
415423
{
416424
return c == ' ' || (c >= 0x09 && c <= 0x0D);
@@ -447,6 +455,7 @@ bool isWhite(dchar c) @safe pure nothrow @nogc
447455
Params: c = The character to test.
448456
Returns: Whether `c` is a control character.
449457
+/
458+
pragma(inline, true)
450459
bool isControl(dchar c) @safe pure nothrow @nogc
451460
{
452461
return c < 0x20 || c == 0x7F;
@@ -487,6 +496,7 @@ bool isControl(dchar c) @safe pure nothrow @nogc
487496
all ASCII characters which are not control characters, letters, digits, or
488497
whitespace.
489498
+/
499+
pragma(inline, true)
490500
bool isPunctuation(dchar c) @safe pure nothrow @nogc
491501
{
492502
return c <= '~' && c >= '!' && !isAlphaNum(c);
@@ -531,6 +541,7 @@ bool isPunctuation(dchar c) @safe pure nothrow @nogc
531541
Returns: Whether or not `c` is a printable character other than the
532542
space character.
533543
+/
544+
pragma(inline, true)
534545
bool isGraphical(dchar c) @safe pure nothrow @nogc
535546
{
536547
return '!' <= c && c <= '~';
@@ -567,6 +578,7 @@ bool isGraphical(dchar c) @safe pure nothrow @nogc
567578
Returns: Whether or not `c` is a printable character - including the
568579
space character.
569580
+/
581+
pragma(inline, true)
570582
bool isPrintable(dchar c) @safe pure nothrow @nogc
571583
{
572584
return c >= ' ' && c <= '~';

0 commit comments

Comments
 (0)