diff options
| author | Michael Forney <mforney@mforney.org> | 2020-06-21 15:42:14 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2020-06-22 22:47:59 -0700 |
| commit | adc036f58ed4722f363abebce69223af9059b0ad (patch) | |
| tree | 88f655b98e149f5150bd99e04b92e603bab2a4b7 /ninja.lua | |
| parent | d921287a261883e205eef33f077cee89027a030b (diff) | |
Style
Diffstat (limited to 'ninja.lua')
| -rw-r--r-- | ninja.lua | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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 |
