aboutsummaryrefslogtreecommitdiff
path: root/cpu.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-10-05 00:10:47 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-10-05 00:10:47 +0200
commit4602ca2fa5e8e2e408713f72ae7e4cd14480bc01 (patch)
treebfbf75b8afd738f5a036737404f3eafe87586c66 /cpu.lua
parentaf4e85f99d0ac63127f19640ef47d768d7bed7cd (diff)
downloadvicious-legacy-4602ca2fa5e8e2e408713f72ae7e4cd14480bc01.tar.xz
Lots of coding style changes
Diffstat (limited to 'cpu.lua')
-rw-r--r--cpu.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/cpu.lua b/cpu.lua
index 73250ee..9dabb7f 100644
--- a/cpu.lua
+++ b/cpu.lua
@@ -10,6 +10,10 @@ local io = { open = io.open }
local setmetatable = setmetatable
local math = { floor = math.floor }
local table = { insert = table.insert }
+local string = {
+ find = string.find,
+ gmatch = string.gmatch
+}
-- }}}
@@ -29,13 +33,13 @@ local function worker(format)
local cpu_lines = {}
for line in f:lines() do
- if line:find("^cpu") then
+ if string.find(line, "^cpu") then
if #cpu_lines < 1 then cpuid = 1
else cpuid = #cpu_lines + 1 end
cpu_lines[cpuid] = {}
- for match in line:gmatch("[%s]+([%d]+)") do
- table.insert(cpu_lines[cpuid], match)
+ for i in string.gmatch(line, "[%s]+([%d]+)") do
+ table.insert(cpu_lines[cpuid], i)
end
end
end