Skip to content
Permalink
Browse files

Use std.append, not join, in flattening list for minimal copying

  • Loading branch information
thesephist committed Mar 13, 2020
1 parent f9133de commit 1124193c9254f9579f041fb4a764abd1f9809b26
Showing with 1 addition and 1 deletion.
  1. +1 −1 samples/std.ink
@@ -171,7 +171,7 @@ reduceBack := (list, f, acc) => (sub := (i, acc) => i :: {
})(len(list) - 1, acc)

` flatten by depth 1 `
flatten := list => reduce(list, join, [])
flatten := list => reduce(list, append, [])

` true iff some items in list are true `
some := list => reduce(list, (acc, x) => acc | x, false)

0 comments on commit 1124193

Please sign in to comment.
You can’t perform that action at this time.