summaryrefslogtreecommitdiffstats
path: root/qtest.lua
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@mailme.dk>2011-03-09 17:05:43 +0100
committerEmil Renner Berthing <esmil@mailme.dk>2011-03-09 17:05:43 +0100
commit3a4878e7e6aa8b973497c28eec6104be89a7c00d (patch)
tree1544498c9ab5ae2f6511bbc107ba1137a0292836 /qtest.lua
parent0b728575358645f6e9a3f98959dd6995325f7380 (diff)
downloadlem-postgres-3a4878e7e6aa8b973497c28eec6104be89a7c00d.tar.gz
lem-postgres-3a4878e7e6aa8b973497c28eec6104be89a7c00d.tar.xz
lem-postgres-3a4878e7e6aa8b973497c28eec6104be89a7c00d.zip
nitpick Lua code
Diffstat (limited to 'qtest.lua')
-rwxr-xr-xqtest.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/qtest.lua b/qtest.lua
index c1c9c0e..c1c0f18 100755
--- a/qtest.lua
+++ b/qtest.lua
@@ -24,14 +24,14 @@ do
local write, format, tostring = io.write, string.format, tostring
function prettyprint(t)
- local widths = {}
- for i = 1, #t[0] do
+ local widths, columns = {}, #t[0]
+ for i = 1, columns do
widths[i] = 0
end
for i = 0, #t do
local row = t[i]
- for j = 1, #row do
+ for j = 1, columns do
local value = row[j]
if value and #value > widths[j] then
widths[j] = #value
@@ -45,7 +45,7 @@ do
for i = 0, #t do
local row = t[i]
- for j = 1, #row do
+ for j = 1, columns do
write(format(widths[j], row[j] or 'NULL'))
end
write('\n')