summaryrefslogtreecommitdiff
path: root/ninja.lua
diff options
context:
space:
mode:
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