summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xqtest.lua8
-rw-r--r--queued.lua2
-rwxr-xr-xtest.lua8
3 files changed, 9 insertions, 9 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')
diff --git a/queued.lua b/queued.lua
index 05496e4..d244e61 100644
--- a/queued.lua
+++ b/queued.lua
@@ -93,4 +93,4 @@ return {
connect = qconnect,
}
--- vim: syntax=lua ts=2 sw=2 noet:
+-- vim: ts=2 sw=2 noet:
diff --git a/test.lua b/test.lua
index 4c56263..36cb690 100755
--- a/test.lua
+++ b/test.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')