refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-29 16:37:28 +02:00
parent 094a32260b
commit f3e23ea642
5 changed files with 70 additions and 47 deletions
+2 -3
View File
@@ -50,8 +50,7 @@ function public.read_list(schema, str)
if str == '' then return t end
local separator = schema[2]
local element_type = schema[3]
local parts = split(str, separator)
return map(parts, function(part)
return map(split(str, separator), function(part)
return read(element_type, part)
end)
end
@@ -59,7 +58,7 @@ end
function public.write_list(schema, list)
local separator = schema[2]
local element_type = schema[3]
local parts = map(list, function(element)
local parts = map(copy(list), function(element)
return write(element_type, element)
end)
return join(parts, separator)