From ba9011f002848a80f652c34ea43e537404cf6f3e Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sat, 22 Jun 2019 17:00:12 -0400 Subject: [PATCH] Use each in flatten(). It's faster. --- arrays.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arrays.scad b/arrays.scad index bbf8951..69007f0 100644 --- a/arrays.scad +++ b/arrays.scad @@ -541,7 +541,7 @@ function array_group(v, cnt=2, dflt=0) = [for (i = [0:cnt:len(v)-1]) [for (j = [ // l = List to flatten. // Example: // flatten([[1,2,3], [4,5,[6,7,8]]]) returns [1,2,3,4,5,[6,7,8]] -function flatten(l) = [for (a = l) for (b = a) b]; +function flatten(l) = [for (a = l) each a]; // Internal. Not exposed.