1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-28 17:00:00 +02:00

performance improved

This commit is contained in:
Justin Lin
2022-03-04 19:44:08 +08:00
parent ccbcac6a10
commit 2771e2cd31

View File

@@ -9,5 +9,8 @@
**/
function sum(lt) =
let(leng = len(lt))
[for(i = 0; i < leng; i = i + 1) 1] * lt;
let(
end = len(lt) - 1,
cum_total = [for(i = 0, s = lt[0]; i < end; i = i + 1, s = s + lt[i]) s]
)
cum_total[len(cum_total) - 1] + lt[end];