From feca5da29b94224f0c78c6213a6578469ff8f217 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sun, 11 Oct 2009 16:08:52 +0200 Subject: mem: tonumber is redudant --- mem.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'mem.lua') 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() -- cgit v1.2.3