diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-10-11 16:08:52 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-10-11 16:09:14 +0200 |
commit | c5738ae0ba6198e7278143b2fa1cafa672845d5a (patch) | |
tree | 395c1cd8d7d4883841b7bf7e945803d17b66f3b5 | |
parent | 114d43de5b67ede0075aa3cd0b8c8c90bcbfed98 (diff) | |
download | vicious-legacy-c5738ae0ba6198e7278143b2fa1cafa672845d5a.tar.xz |
mem: tonumber is redudant
-rw-r--r-- | mem.lua | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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() |