simplified setup()

This commit is contained in:
kdav5758
2021-07-01 17:35:47 -05:00
parent e92b0cc692
commit 20bd237ac9
3 changed files with 3 additions and 12 deletions
+1 -12
View File
@@ -14,19 +14,8 @@ function config.set_options(opts)
opts = opts or {}
for opt, _ in pairs(opts) do
-- check if option exists in the config's table
if (config.options[opt] ~= nil) then -- not nil
-- chec if option is a table
if (type(opts[opt]) == "table") then -- if table
for inner_opt, _ in pairs(opts[opt]) do
-- table contains element by that key
if (config.options[opt][inner_opt] ~= nil) then -- not nil
config.options[opt][inner_opt] = opts[opt][inner_opt]
end
end
else
config.options[opt] = opts[opt]
end
config.options[opt] = opts[opt]
end
end
end