mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-20 13:31:30 +02:00
return first when leng is 1
This commit is contained in:
@@ -9,8 +9,7 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
function sum(lt) =
|
function sum(lt) =
|
||||||
let(
|
let(end = len(lt) - 1)
|
||||||
end = len(lt) - 1,
|
end == 0 ? lt[0] :
|
||||||
cum_total = [for(i = 0, s = lt[0]; i < end; i = i + 1, s = s + lt[i]) s]
|
let(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];
|
cum_total[len(cum_total) - 1] + lt[end];
|
Reference in New Issue
Block a user