diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2010-03-13 02:11:41 +0100 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2010-03-13 02:11:41 +0100 |
commit | 96a8e557d3bb9b887dd7d504a4c20f05a87e6cbe (patch) | |
tree | a3f33876efaf5a3473f8aaa72a08368009fc4d2e /org.lua | |
parent | 6441db0a9408a88780494d476f6611a52b41a24d (diff) | |
download | vicious-legacy-96a8e557d3bb9b887dd7d504a4c20f05a87e6cbe.tar.xz |
Make use of io.lines() where appropriate
Diffstat (limited to 'org.lua')
-rw-r--r-- | org.lua | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -5,7 +5,7 @@ --------------------------------------------------- -- {{{ Grab environment -local io = { open = io.open } +local io = { lines = io.lines } local setmetatable = setmetatable local string = { find = string.find } local os = { @@ -31,9 +31,7 @@ local function worker(format, warg) -- Get data from agenda files for i=1, #warg do - local f = io.open(warg[i]) - - for line in f:lines() do + for line in io.lines(warg[i]) do local scheduled = string.find(line, "SCHEDULED:") local closed = string.find(line, "CLOSED:") local deadline = string.find(line, "DEADLINE:") @@ -56,7 +54,6 @@ local function worker(format, warg) end end end - f:close() end return {count.past, count.today, count.soon, count.future} |