Skip to content

Commit 763875a

Browse files
authored
Merge pull request #15108 from darquro/fast-path-ad-hoc-printing-of-strings
[stdlib][SR-7136] Fast-path ad-hoc printing of Strings
2 parents 22b0526 + a77336a commit 763875a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stdlib/public/core/OutputStream.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,12 @@ internal func _print_unlocked<T, TargetStream: TextOutputStream>(
391391
debugPrintable.debugDescription.write(to: &target)
392392
return
393393
}
394+
395+
if let string = value as? String {
396+
target.write(string)
397+
return
398+
}
399+
394400
if case let streamableObject as TextOutputStreamable = value {
395401
streamableObject.write(to: &target)
396402
return

0 commit comments

Comments
 (0)