diff --git a/basis/io/streams/byte-array/fast/fast.factor b/basis/io/streams/byte-array/fast/fast.factor index 2948e2bc61..9f74d0778b 100644 --- a/basis/io/streams/byte-array/fast/fast.factor +++ b/basis/io/streams/byte-array/fast/fast.factor @@ -1,6 +1,7 @@ ! Copyright (C) 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: alien byte-vectors io kernel libc math sequences ; +USING: alien byte-arrays byte-vectors io kernel libc math +sequences ; IN: io.streams.byte-array.fast ! This is split off from io.streams.byte-array because it uses @@ -8,6 +9,10 @@ IN: io.streams.byte-array.fast ! optimizing compiler has been loaded. M: byte-vector stream-write - [ dup byte-length tail-slice swap ] - [ [ [ byte-length ] bi@ + ] keep lengthen ] 2bi - dup byte-length memcpy ; + over byte-array? [ + push-all ! faster than memcpy + ] [ + 2dup [ byte-length ] bi@ + 3dup + swap lengthen + [ tail-slice swap ] curry dip memcpy + ] if ;