From fbffd18fd266ba1b03d2016556945f8da8faf22b Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 23 Mar 2021 09:08:37 -0700 Subject: [PATCH] splitting: faster split-when. The old way would accumulate in a vector and then add the last item on by copying to a new array. The new way accumulates in a vector including the last item and then returns an array. --- core/splitting/splitting.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/splitting/splitting.factor b/core/splitting/splitting.factor index 6b83ea79e0..464d1a3fc9 100644 --- a/core/splitting/splitting.factor +++ b/core/splitting/splitting.factor @@ -78,10 +78,10 @@ PRIVATE> [ 0 ] 3dip pick [ swap curry [ keep 1 + swap ] curry [ [ find-from drop dup ] 2curry [ keep -rot ] curry - ] dip produce nip + ] dip V{ } produce-as nip ] 2keep swap [ [ length swapd ] keep - ] dip 2curry call suffix ; inline + ] dip 2curry call suffix! { } like ; inline PRIVATE> -- 2.34.1