Skip to content

Commit a10a715

Browse files
lattnertkremenek
authored andcommitted
Stop pessimizing print performance for no reason.
As pointed out in Ole Begeman's blog: https://oleb.net/blog/2016/09/playground-print-hook/ The playground print hook is being initialized a a non-null noop hook, which causes the fast paths in the print functions to be unused, and forcing the creation of a tee stream for things that have nothing to do with playgrounds. It is sad that no one noticed this...
1 parent f1ba749 commit a10a715

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/core/OutputStream.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ extension Unicode.Scalar : TextOutputStreamable {
624624
}
625625

626626
/// A hook for playgrounds to print through.
627-
public var _playgroundPrintHook : ((String) -> Void)? = {_ in () }
627+
public var _playgroundPrintHook : ((String) -> Void)? = nil
628628

629629
@_fixed_layout // FIXME(sil-serialize-all)
630630
@_versioned // FIXME(sil-serialize-all)

0 commit comments

Comments
 (0)