Merge pull request #2101 from 2tata/tata_200-wireless
gluon-core: 200-wireless simplify if conditions
This commit is contained in:
commit
e9462b5b82
@ -82,20 +82,20 @@ local function get_htmode(radio)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function is_disabled(name)
|
local function is_disabled(name)
|
||||||
if uci:get('wireless', name) then
|
if not uci:get('wireless', name) then
|
||||||
return uci:get_bool('wireless', name, 'disabled')
|
|
||||||
else
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return uci:get_bool('wireless', name, 'disabled')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the first argument that is not nil; don't call without any non-nil arguments!
|
-- Returns the first argument that is not nil; don't call without any non-nil arguments!
|
||||||
local function first_non_nil(first, ...)
|
local function first_non_nil(first, ...)
|
||||||
if first ~= nil then
|
if first ~= nil then
|
||||||
return first
|
return first
|
||||||
else
|
|
||||||
return first_non_nil(...)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return first_non_nil(...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user