From 6fbc8d7359ce7f3396e53fbdf252df82418419a0 Mon Sep 17 00:00:00 2001 From: Guillaume LE VAILLANT Date: Thu, 1 Mar 2018 10:28:36 +0100 Subject: [PATCH] Optimise write-sequence on broadcast-stream Call write-sequence on all the streams of the broadcast-stream. --- src/code/stream.lisp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/code/stream.lisp b/src/code/stream.lisp index c167c334f..b13be574f 100644 --- a/src/code/stream.lisp +++ b/src/code/stream.lisp @@ -2277,10 +2277,13 @@ benefit of the function GET-OUTPUT-STREAM-STRING." (type index start) (type sequence-end end) (values sequence)) - (if (ansi-stream-p stream) - (ansi-stream-write-sequence seq stream start end) - ;; must be Gray-streams FUNDAMENTAL-STREAM - (stream-write-sequence stream seq start end))) + (if (typep stream 'broadcast-stream) + (dolist (s (broadcast-stream-streams stream) seq) + (write-sequence seq s :start start :end end)) + (if (ansi-stream-p stream) + (ansi-stream-write-sequence seq stream start end) + ;; must be Gray-streams FUNDAMENTAL-STREAM + (stream-write-sequence stream seq start end)))) ;;; This macro allows sharing code between ;;; WRITE-SEQUENCE/WRITE-FUNCTION and SB-GRAY:STREAM-WRITE-STRING. -- 2.16.2