io.ports: make read-step inline

db4
Joe Groff 2011-11-09 19:59:46 -08:00
parent 47cedd8d3d
commit d685cb6502
1 changed files with 2 additions and 5 deletions

View File

@ -46,15 +46,12 @@ M: input-port stream-read1
dup check-disposed
dup wait-to-read [ drop f ] [ buffer>> buffer-pop ] if ; inline
! TYPED: read-step ( count: fixnum port: input-port -- count: fixnum ptr/f: c-ptr )
: (read-step) ( count: fixnum port: input-port -- count: fixnum ptr/f: c-ptr )
: read-step ( count port -- count ptr/f )
{
{ [ over 0 = ] [ 2drop 0 f ] }
{ [ dup wait-to-read ] [ 2drop 0 f ] }
[ buffer>> buffer-read-unsafe ]
} cond ;
: read-step ( count port -- count ptr/f )
(read-step) { fixnum c-ptr } declare ; inline
} cond ; inline
: prepare-read ( count stream -- count stream )
dup check-disposed [ 0 max >fixnum ] dip ; inline