Commit c4df4768 authored by François Perrad's avatar François Perrad
Browse files

remove useless return

parent 5d3bbc14
......@@ -217,9 +217,9 @@ local set_array = function (array)
is_map = true
end
if is_map then
return packers['map'](buffer, tbl, n)
packers['map'](buffer, tbl, n)
else
return packers['array'](buffer, tbl, n)
packers['array'](buffer, tbl, n)
end
end
elseif array == 'with_hole' then
......@@ -236,9 +236,9 @@ local set_array = function (array)
n = n + 1
end
if is_map then
return packers['map'](buffer, tbl, n)
packers['map'](buffer, tbl, n)
else
return packers['array'](buffer, tbl, max)
packers['array'](buffer, tbl, max)
end
end
elseif array == 'always_as_map' then
......@@ -247,7 +247,7 @@ local set_array = function (array)
for k in pairs(tbl) do
n = n + 1
end
return packers['map'](buffer, tbl, n)
packers['map'](buffer, tbl, n)
end
else
argerror('set_array', 1, "invalid option '" .. array .."'")
......@@ -256,7 +256,7 @@ end
m.set_array = set_array
packers['table'] = function (buffer, tbl)
return packers['_table'](buffer, tbl)
packers['_table'](buffer, tbl)
end
packers['unsigned'] = function (buffer, n)
......@@ -461,17 +461,17 @@ local set_number = function (number)
elseif number == 'float' then
packers['number'] = function (buffer, n)
if floor(n) == n and n < maxinteger and n > mininteger then
return packers['integer'](buffer, n)
packers['integer'](buffer, n)
else
return packers['float'](buffer, n)
packers['float'](buffer, n)
end
end
elseif number == 'double' then
packers['number'] = function (buffer, n)
if floor(n) == n and n < maxinteger and n > mininteger then
return packers['integer'](buffer, n)
packers['integer'](buffer, n)
else
return packers['double'](buffer, n)
packers['double'](buffer, n)
end
end
else
......
......@@ -166,9 +166,9 @@ local set_array = function (array)
is_map = true
end
if is_map then
return packers['map'](buffer, tbl, n)
packers['map'](buffer, tbl, n)
else
return packers['array'](buffer, tbl, n)
packers['array'](buffer, tbl, n)
end
end
elseif array == 'with_hole' then
......@@ -185,9 +185,9 @@ local set_array = function (array)
n = n + 1
end
if is_map then
return packers['map'](buffer, tbl, n)
packers['map'](buffer, tbl, n)
else
return packers['array'](buffer, tbl, max)
packers['array'](buffer, tbl, max)
end
end
elseif array == 'always_as_map' then
......@@ -196,7 +196,7 @@ local set_array = function (array)
for k in pairs(tbl) do
n = n + 1
end
return packers['map'](buffer, tbl, n)
packers['map'](buffer, tbl, n)
end
else
argerror('set_array', 1, "invalid option '" .. array .."'")
......@@ -205,7 +205,7 @@ end
m.set_array = set_array
packers['table'] = function (buffer, tbl)
return packers['_table'](buffer, tbl)
packers['_table'](buffer, tbl)
end
packers['unsigned'] = function (buffer, n)
......@@ -287,17 +287,17 @@ local set_number = function (number)
elseif number == 'float' then
packers['number'] = function (buffer, n)
if math_type(n) == 'integer' then
return packers['integer'](buffer, n)
packers['integer'](buffer, n)
else
return packers['float'](buffer, n)
packers['float'](buffer, n)
end
end
elseif number == 'double' then
packers['number'] = function (buffer, n)
if math_type(n) == 'integer' then
return packers['integer'](buffer, n)
packers['integer'](buffer, n)
else
return packers['double'](buffer, n)
packers['double'](buffer, n)
end
end
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment