Skip to content

Commit 9b851b8

Browse files
committed
Inline more trivial functions
1 parent e22a854 commit 9b851b8

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

std/encoding.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,6 +1666,7 @@ Returns true if c is a valid code point
16661666
Params:
16671667
c = the code point to be tested
16681668
*/
1669+
pragma(inline, true)
16691670
bool isValidCodePoint(dchar c) @safe pure nothrow @nogc
16701671
{
16711672
return c < 0xD800 || (c >= 0xE000 && c < 0x110000);

std/math/traits.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if (isFloatingPoint!(X))
3434
{
3535
version (all)
3636
{
37+
pragma(inline, true);
3738
return x != x;
3839
}
3940
else

std/path.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ else static assert(0, "unsupported platform");
152152
On Windows, this includes both $(D `\`) and $(D `/`).
153153
On POSIX, it's just $(D `/`).
154154
*/
155+
pragma(inline, true)
155156
bool isDirSeparator(dchar c) @safe pure nothrow @nogc
156157
{
157158
if (c == '/') return true;

std/uni/package.d

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,6 +1612,7 @@ string genUnrolledSwitchSearch(size_t size) @safe pure nothrow
16121612
return code;
16131613
}
16141614

1615+
pragma(inline, true)
16151616
bool isPow2OrZero(size_t sz) @safe pure nothrow @nogc
16161617
{
16171618
// See also: std.math.isPowerOf2()
@@ -9161,6 +9162,7 @@ public bool isWhite(dchar c)
91619162
/++
91629163
Return whether `c` is a Unicode lowercase $(CHARACTER).
91639164
+/
9165+
pragma(inline, true)
91649166
@safe pure nothrow @nogc
91659167
bool isLower(dchar c)
91669168
{
@@ -9194,6 +9196,7 @@ bool isLower(dchar c)
91949196
/++
91959197
Return whether `c` is a Unicode uppercase $(CHARACTER).
91969198
+/
9199+
pragma(inline, true)
91979200
@safe pure nothrow @nogc
91989201
bool isUpper(dchar c)
91999202
{
@@ -10433,6 +10436,7 @@ if (!isSomeString!S && (isRandomAccessRange!S && hasLength!S && hasSlicing!S &&
1043310436
Returns whether `c` is a Unicode alphabetic $(CHARACTER)
1043410437
(general Unicode category: Alphabetic).
1043510438
+/
10439+
pragma(inline, true)
1043610440
@safe pure nothrow @nogc
1043710441
bool isAlpha(dchar c)
1043810442
{
@@ -10478,6 +10482,7 @@ bool isMark(dchar c)
1047810482
Returns whether `c` is a Unicode numerical $(CHARACTER)
1047910483
(general Unicode category: Nd, Nl, No).
1048010484
+/
10485+
pragma(inline, true)
1048110486
@safe pure nothrow @nogc
1048210487
bool isNumber(dchar c)
1048310488
{
@@ -10511,6 +10516,7 @@ bool isNumber(dchar c)
1051110516
`true` if the character is in the Alphabetic, Nd, Nl, or No Unicode
1051210517
categories
1051310518
+/
10519+
pragma(inline, true)
1051410520
@safe pure nothrow @nogc
1051510521
bool isAlphaNum(dchar c)
1051610522
{
@@ -10548,6 +10554,7 @@ bool isAlphaNum(dchar c)
1054810554
Returns whether `c` is a Unicode punctuation $(CHARACTER)
1054910555
(general Unicode category: Pd, Ps, Pe, Pc, Po, Pi, Pf).
1055010556
+/
10557+
pragma(inline, true)
1055110558
@safe pure nothrow @nogc
1055210559
bool isPunctuation(dchar c)
1055310560
{
@@ -10695,6 +10702,7 @@ bool isFormat(dchar c)
1069510702
Returns whether `c` is a Unicode Private Use $(CODEPOINT)
1069610703
(general Unicode category: Co).
1069710704
+/
10705+
pragma(inline, true)
1069810706
@safe pure nothrow @nogc
1069910707
bool isPrivateUse(dchar c)
1070010708
{
@@ -10707,6 +10715,7 @@ bool isPrivateUse(dchar c)
1070710715
Returns whether `c` is a Unicode surrogate $(CODEPOINT)
1070810716
(general Unicode category: Cs).
1070910717
+/
10718+
pragma(inline, true)
1071010719
@safe pure nothrow @nogc
1071110720
bool isSurrogate(dchar c)
1071210721
{
@@ -10716,6 +10725,7 @@ bool isSurrogate(dchar c)
1071610725
/++
1071710726
Returns whether `c` is a Unicode high surrogate (lead surrogate).
1071810727
+/
10728+
pragma(inline, true)
1071910729
@safe pure nothrow @nogc
1072010730
bool isSurrogateHi(dchar c)
1072110731
{
@@ -10725,6 +10735,7 @@ bool isSurrogateHi(dchar c)
1072510735
/++
1072610736
Returns whether `c` is a Unicode low surrogate (trail surrogate).
1072710737
+/
10738+
pragma(inline, true)
1072810739
@safe pure nothrow @nogc
1072910740
bool isSurrogateLo(dchar c)
1073010741
{

std/utf.d

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ if (isSomeChar!Char)
271271
`'\uFFFE'` and `'\uFFFF'` are considered valid by `isValidDchar`,
272272
as they are permitted for internal use by an application, but they are
273273
not allowed for interchange by the Unicode standard.
274-
+/
274+
+/
275+
pragma(inline, true)
275276
bool isValidDchar(dchar c) pure nothrow @safe @nogc
276277
{
277278
return c < 0xD800 || (c > 0xDFFF && c <= 0x10FFFF);
@@ -325,6 +326,7 @@ Params:
325326
Returns:
326327
`true`, if `c` forms a valid code point.
327328
*/
329+
pragma(inline, true)
328330
bool isValidCodepoint(Char)(Char c)
329331
if (isSomeChar!Char)
330332
{

0 commit comments

Comments
 (0)