It's not necessary to execute all code if section already exists.
Signed-off-by: Darius Joksas <jok.darius@gmail.com>
[reword commit message, squash commits, remove stray semicolon]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if name then
-- Ignore if it already exists
if self:cfgvalue(name) then
- name = nil;
- end
-
- name = self:checkscope(name)
-
- if not name then
+ name = nil
self.err_invalid = true
- end
+ else
+ name = self:checkscope(name)
+
+ if not name then
+ self.err_invalid = true
+ end
- if name and #name > 0 then
- created = self:create(name, origin) and name
- if not created then
- self.invalid_cts = true
+ if name and #name > 0 then
+ created = self:create(name, origin) and name
+ if not created then
+ self.invalid_cts = true
+ end
end
end
end