aboutsummaryrefslogtreecommitdiff
path: root/mem.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-10-11 16:08:52 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-10-11 16:08:52 +0200
commitfeca5da29b94224f0c78c6213a6578469ff8f217 (patch)
treecc1e1477e21f3d64e4f8c2a7db620d54a444c5c7 /mem.lua
parent7f3d31e0cb8cdf18ee0d3c96e54fdbd0a7bcca17 (diff)
downloadvicious-legacy-feca5da29b94224f0c78c6213a6578469ff8f217.tar.xz
mem: tonumber is redudant
Diffstat (limited to 'mem.lua')
-rw-r--r--mem.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/mem.lua b/mem.lua
index 7615c79..3f874dd 100644
--- a/mem.lua
+++ b/mem.lua
@@ -5,7 +5,6 @@
---------------------------------------------------
-- {{{ Grab environment
-local tonumber = tonumber
local io = { open = io.open }
local setmetatable = setmetatable
local math = { floor = math.floor }
@@ -25,18 +24,18 @@ local function worker(format)
for line in f:lines() do
if string.match(line, "^MemTotal.*") then
- mem.total = math.floor(tonumber(string.match(line, "([%d]+)"))/1024)
+ mem.total = math.floor(string.match(line, "([%d]+)")/1024)
elseif string.match(line, "^MemFree.*") then
- mem.buf.f = math.floor(tonumber(string.match(line, "([%d]+)"))/1024)
+ mem.buf.f = math.floor(string.match(line, "([%d]+)")/1024)
elseif string.match(line, "^Buffers.*") then
- mem.buf.b = math.floor(tonumber(string.match(line, "([%d]+)"))/1024)
+ mem.buf.b = math.floor(string.match(line, "([%d]+)")/1024)
elseif string.match(line, "^Cached.*") then
- mem.buf.c = math.floor(tonumber(string.match(line, "([%d]+)"))/1024)
+ mem.buf.c = math.floor(string.match(line, "([%d]+)")/1024)
-- Get swap stats while we are at it
elseif string.match(line, "^SwapTotal.*") then
- mem.swp.total = math.floor(tonumber(string.match(line, "([%d]+)"))/1024)
+ mem.swp.total = math.floor(string.match(line, "([%d]+)")/1024)
elseif string.match(line, "^SwapFree.*") then
- mem.swp.free = math.floor(tonumber(string.match(line, "([%d]+)"))/1024)
+ mem.swp.free = math.floor(string.match(line, "([%d]+)")/1024)
end
end
f:close()