sequences.extras: faster join-with.
If we initialize the array with the glue, then we just set every other element from the input sequence.windows-high-dpi
parent
7f5f4c348a
commit
112d374aed
|
@ -627,6 +627,5 @@ PRIVATE>
|
||||||
[ dup length ] unless* tail-slice ; inline
|
[ dup length ] unless* tail-slice ; inline
|
||||||
|
|
||||||
: join-with ( seq glue -- newseq )
|
: join-with ( seq glue -- newseq )
|
||||||
V{ } clone [
|
[ dup length dup 1 - + 0 max ] dip <array>
|
||||||
[ '[ _ _ push ] ] [ '[ _ push ] ] bi interleave
|
[ '[ 2 * _ set-nth-unsafe ] each-index ] keep ;
|
||||||
] keep { } like ;
|
|
||||||
|
|
Loading…
Reference in New Issue