From 9082d055824fe46e214ed26422474569e679c416 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 12 Oct 2011 16:32:52 -0700 Subject: [PATCH] io: tweak each-block* to be byte- or char-agnostic --- core/io/io.factor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/io/io.factor b/core/io/io.factor index d3dae4e128..521d4b573d 100644 --- a/core/io/io.factor +++ b/core/io/io.factor @@ -110,14 +110,14 @@ PRIVATE> : each-stream-block ( ... stream quot: ( ... block -- ... ) -- ... ) swap [ 65536 swap stream-read-partial ] curry each-morsel ; inline -: each-stream-block* ( ... buffer stream quot: ( ... n ptr -- ... ) -- ... ) - -rot [ [ byte-length ] [ >c-ptr ] bi ] dip +: each-stream-block* ( ... buffer stream quot: ( ... n buffer -- ... ) -- ... ) + -rot [ [ length ] keep ] dip [ [ stream-read-partial-unsafe ] curry keep ] 3curry each-morsel ; inline : each-block ( ... quot: ( ... block -- ... ) -- ... ) input-stream get swap each-stream-block ; inline -: each-block* ( ... quot: ( ... block -- ... ) -- ... ) +: each-block* ( ... buffer quot: ( ... n ptr -- ... ) -- ... ) input-stream get swap each-stream-block* ; inline : stream-contents ( stream -- seq )