Remove the insane "fold" operation, replace with saner "reduce".
This commit is contained in:
1 parent
8fbee891b3
commit
bc42812715
7 files changed
+37
-38
No files matched your search
+1
-1
@@ -379,7 +379,7 @@ def fac: if . == 1 then 1 else . * (. - 1 | fac) end; [.[] | fac]
|
||||
# []
|
||||
# 1001
|
||||
|
||||
fold 0 as $s (.[] | $s + .)
|
||||
reduce .[] as $x (0; . + $x)
|
||||
[1,2,4]
|
||||
7
|
||||
|
||||
|
||||
Reference in new issue
Block a user