Commit 8e289c58 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

streamlined variable expansion

side effects removed
parent acb661e8
......@@ -60,17 +60,10 @@ end
function PolicyConfig:expand()
local function expand(obj)
for k, v in pairs(obj) do
if type(v) == 'table' then expand(v)
else obj[k] = self:eval(v) end
end
end
for k, v in pairs(self.data) do
if k ~= 'variable' then expand(v) end
return type(obj) == 'table' and util.map(obj, expand) or self:eval(obj)
end
return self.data
return expand(self.data)
end
......
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