From d81eed6d310bce28b3709980d80c433a04eefaae Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Mon, 5 Oct 2009 00:10:47 +0200 Subject: Lots of coding style changes --- dio.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'dio.lua') diff --git a/dio.lua b/dio.lua index dfde90c..9c94134 100644 --- a/dio.lua +++ b/dio.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 = { + match = string.match, + gmatch = string.gmatch +} -- }}} @@ -28,14 +32,14 @@ local function worker(format, disk) local disk_lines = {} for line in f:lines() do - if line:match("("..disk..")%s") then + if string.match(line, "("..disk..")%s") then -- Todo: find a way to do this - --for stat in line:gmatch("%s([%d]+)") do + --for stat in string.gmatch(line, "%s([%d]+)") do -- table.insert(disk_lines, stat) --end -- -- Skip first two matches - local stat = line:gmatch("%s([%d]+)") + local stat = string.gmatch(line, "%s([%d]+)") stat() stat() -- Store the rest -- cgit v1.2.3