summaryrefslogtreecommitdiff
path: root/lualibs-util-tab.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-12-29 23:41:38 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-12-29 23:41:38 +0100
commit6632b6a8c3815670fef4257c136d461583052120 (patch)
tree71b61874b88071bf388319395b593dcfd9961755 /lualibs-util-tab.lua
parent281539cf53b8ec43d72e06cbdba874b2de6e758d (diff)
downloadlualibs-6632b6a8c3815670fef4257c136d461583052120.tar.gz
sync with Context as of 2014-12-29
Diffstat (limited to 'lualibs-util-tab.lua')
-rw-r--r--lualibs-util-tab.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/lualibs-util-tab.lua b/lualibs-util-tab.lua
index 077c906..5eae0d5 100644
--- a/lualibs-util-tab.lua
+++ b/lualibs-util-tab.lua
@@ -623,7 +623,7 @@ function table.serialize(root,name,specification)
depth = depth + 1
end
-- we could check for k (index) being number (cardinal)
- if root and next(root) then
+ if root and next(root) ~= nil then
local first = nil
local last = 0
last = #root
@@ -648,7 +648,7 @@ function table.serialize(root,name,specification)
elseif tv == "string" then
n = n + 1 t[n] = f_val_str(depth,v)
elseif tv == "table" then
- if not next(v) then
+ if next(v) == nil then
n = n + 1 t[n] = f_val_not(depth)
else
local st = simple_table(v)
@@ -678,7 +678,7 @@ function table.serialize(root,name,specification)
n = n + 1 t[n] = f_key_boo_value_str(depth,k,v)
end
elseif tv == "table" then
- if not next(v) then
+ if next(v) == nil then
if tk == "number" then
n = n + 1 t[n] = f_key_num_value_not(depth,k,v)
elseif tk == "string" then
@@ -742,7 +742,7 @@ function table.serialize(root,name,specification)
root._w_h_a_t_e_v_e_r_ = nil
end
-- Let's forget about empty tables.
- if next(root) then
+ if next(root) ~= nil then
do_serialize(root,name,1,0)
end
end