summaryrefslogtreecommitdiff
path: root/ninja.lua
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-06-21 15:42:14 -0700
committerMichael Forney <mforney@mforney.org>2020-06-22 22:47:59 -0700
commitadc036f58ed4722f363abebce69223af9059b0ad (patch)
tree88f655b98e149f5150bd99e04b92e603bab2a4b7 /ninja.lua
parentd921287a261883e205eef33f077cee89027a030b (diff)
Style
Diffstat (limited to 'ninja.lua')
-rw-r--r--ninja.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/ninja.lua b/ninja.lua
index b067dbce..19e0b167 100644
--- a/ninja.lua
+++ b/ninja.lua
@@ -11,13 +11,12 @@ function string.hassuffix(s, suffix)
end
-- collects the results of an iterator into a table
-local function collect(fn, s, i)
- local results, nresults = {}, 0
- for val in fn, s, i do
- nresults = nresults + 1
- results[nresults] = val
+local function collect(f, s, i)
+ local t = {}
+ for v in f, s, i do
+ t[#t + 1] = v
end
- return results
+ return t
end
-- collects the keys of a table into a sorted table