diff --git a/core/io/streams/sequence/sequence.factor b/core/io/streams/sequence/sequence.factor index 3deb847e55..2c98ff87f4 100644 --- a/core/io/streams/sequence/sequence.factor +++ b/core/io/streams/sequence/sequence.factor @@ -11,11 +11,8 @@ SLOT: i : >sequence-stream< ( stream -- i underlying ) [ i>> ] [ underlying>> ] bi ; inline -: next ( stream -- ) - [ 1 + ] change-i drop ; inline - : sequence-read1 ( stream -- elt/f ) - [ >sequence-stream< ?nth ] [ next ] bi ; inline + dup >sequence-stream< dupd ?nth [ 1 + swap i<< ] dip ; inline : (sequence-read-length) ( n buf stream -- buf count ) [ underlying>> length ] [ i>> ] bi - rot min ; inline @@ -39,7 +36,8 @@ SLOT: i : sequence-read-until ( seps stream -- seq sep/f ) [ find-separator ] keep - [ [ (sequence-read-unsafe) ] (read-into-new) ] [ next ] bi swap ; inline + [ [ (sequence-read-unsafe) ] (read-into-new) ] + [ [ 1 + ] change-i drop ] bi swap ; inline ! Writers M: growable dispose drop ;