[
[ (sequence-read-length) ]
[ [ dup pick + ] change-i underlying>> ] bi
- ] dip [ -roll spin dupd + seq-copy-loop drop ] 3curry keep ; inline
+ ] dip [ -roll spin dupd + copy-loop drop ] 3curry keep ; inline
: (sequence-read-unsafe) ( n buf stream -- count )
[ integer>fixnum ]
: subseq-unsafe ( from to seq -- subseq )
dup subseq-unsafe-as ; inline
-: seq-copy-loop ( dst dst-i src src-i src-stop -- dst )
+: copy-loop ( dst dst-i src src-i src-stop -- dst )
2dup >= [
4drop
] [
[
[ copy-nth-of-unsafe ] 4keep
[ 1 + ] 2dip 1 +
- ] dip seq-copy-loop
+ ] dip copy-loop
] if ; inline recursive
PRIVATE>
[ [ to1>> ] [ from1>> fixnum-fast ] [ accum>> length integer>fixnum-strict ] tri [ fixnum+fast >>length ] 2keep ]
[ seq>> ]
[ from1>> roll dupd fixnum+fast ] tri
- seq-copy-loop drop ; inline
+ copy-loop drop ; inline
: dump-r ( merge -- )
[ accum>> ] keep
[ [ to2>> ] [ from2>> fixnum-fast ] [ accum>> length integer>fixnum-strict ] tri [ fixnum+fast >>length ] 2keep ]
[ seq>> ]
[ from2>> roll dupd fixnum+fast ] tri
- seq-copy-loop drop ; inline
+ copy-loop drop ; inline
: l-next ( merge -- )
[ l-elt ] [ [ 1 + ] change-from1 accum>> ] bi push-unsafe ; inline
: seq-grow-copy ( dst n -- dst dst-n )
[ over length + seq-lengthen ] keep 1 - ; inline
-: seq-copy-loop ( dst dst-i src src-i src-stop -- dst )
- 2dup >= [
- 4drop
- ] [
- [
- [ copy-nth-of-unsafe ] 4keep
- [ 1 + ] 2dip 1 +
- ] dip seq-copy-loop
- ] if ; inline recursive
-
: seq-copy-unsafe ( dst dst-i src -- dst )
- 0 over length check-length seq-copy-loop ; inline
+ 0 over length check-length copy-loop ; inline
: seq-push-all ( dst src -- dst ) [ length seq-grow-copy ] keep seq-copy-unsafe ; inline