Changed empty table to be treated as array when encoding

pull/6/head
rxi 2015-09-06 10:31:54 +01:00
parent 19b61e0628
commit 89b0e905ef
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ local function encode_table(val, stack)
stack[val] = true stack[val] = true
if val[1] ~= nil then if val[1] ~= nil or next(val) == nil then
-- Treat as array -- check keys are valid and it is not sparse -- Treat as array -- check keys are valid and it is not sparse
local n = 0 local n = 0
for k in pairs(val) do for k in pairs(val) do