From 3a4b1224e6917d76817f4b611fd1900faf83eb00 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 1 Apr 2022 13:27:56 +0800 Subject: [PATCH] refactor: use each --- src/util/_impl/_zip_impl.scad | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/util/_impl/_zip_impl.scad b/src/util/_impl/_zip_impl.scad index 7176de68..f3eeed6f 100644 --- a/src/util/_impl/_zip_impl.scad +++ b/src/util/_impl/_zip_impl.scad @@ -1,10 +1,6 @@ _identity = function(elems) elems; function _zipAll_sub(lts, list_to, elem_to, combine, i = 0) = - i > elem_to ? [] : - concat( - [combine([for(j = [0:list_to]) lts[j][i]])], - _zipAll_sub(lts, list_to, elem_to, combine, i + 1) - ); + i > elem_to ? [] : [combine([for(j = [0:list_to]) lts[j][i]]), each _zipAll_sub(lts, list_to, elem_to, combine, i + 1)]; function _zipAll(lts, combine = _identity) = _zipAll_sub(lts, len(lts) - 1, len(lts[0]) - 1, combine); \ No newline at end of file