From 1170df3e7133c42bb8fd2f630e8fb183aae4183f Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 25 Feb 2014 08:23:32 -0800 Subject: [PATCH] io.streams.byte-array: faster with-byte-writer. --- core/io/streams/byte-array/byte-array.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/io/streams/byte-array/byte-array.factor b/core/io/streams/byte-array/byte-array.factor index 9872f3aa10..bdbf86f2b8 100644 --- a/core/io/streams/byte-array/byte-array.factor +++ b/core/io/streams/byte-array/byte-array.factor @@ -9,10 +9,10 @@ INSTANCE: byte-vector output-stream M: byte-vector stream-element-type drop +byte+ ; inline : ( encoding -- stream ) - 512 swap ; + 512 swap ; inline : with-byte-writer ( encoding quot -- byte-array ) - [ ] dip [ output-stream get ] compose with-output-stream* + [ ] dip [ with-output-stream* ] 2keep drop dup encoder? [ stream>> ] when >byte-array ; inline TUPLE: byte-reader { underlying byte-array read-only } { i array-capacity } ;