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
|
||||
|
||||
: join-with ( seq glue -- newseq )
|
||||
V{ } clone [
|
||||
[ '[ _ _ push ] ] [ '[ _ push ] ] bi interleave
|
||||
] keep { } like ;
|
||||
[ dup length dup 1 - + 0 max ] dip <array>
|
||||
[ '[ 2 * _ set-nth-unsafe ] each-index ] keep ;
|
||||
|
|
Loading…
Reference in New Issue