Skip to content

Commit 90d58fe

Browse files
committed
[stdlib] Encourage more inlining on String’s UTF-8 decoding fast path
1 parent 83c14bc commit 90d58fe

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/core/String.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ extension String {
458458
contigBytes._providesContiguousBytesNoCopy
459459
{
460460
self = contigBytes.withUnsafeBytes { rawBufPtr in
461+
Builtin.onFastPath() // encourage SIL Optimizer to inline this closure
461462
return String._fromUTF8Repairing(
462463
UnsafeBufferPointer(
463464
start: rawBufPtr.baseAddress?.assumingMemoryBound(to: UInt8.self),

0 commit comments

Comments
 (0)