mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Use each in flatten(). It's faster.
This commit is contained in:
parent
e3be9a3b5b
commit
ba9011f002
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
// l = List to flatten.
|
||||||
// Example:
|
// Example:
|
||||||
// flatten([[1,2,3], [4,5,[6,7,8]]]) returns [1,2,3,4,5,[6,7,8]]
|
// 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.
|
// Internal. Not exposed.
|
||||||
|
|
Loading…
Reference in a new issue