luci-base: luci.model.network: simplify is_auto()
authorJo-Philipp Wich <jo@mein.io>
Tue, 30 Apr 2019 07:05:16 +0000 (09:05 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 30 Apr 2019 07:06:10 +0000 (09:06 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/luasrc/model/network.lua

index dec25a5..67a2de4 100644 (file)
@@ -1160,13 +1160,7 @@ function protocol.is_dynamic(self)
 end
 
 function protocol.is_auto(self)
-       local auto = self:_get("auto")
-
-       if auto == "0" then
-               return false
-       else
-               return true
-       end
+       return (self:_get("auto") ~= "0")
 end
 
 function protocol.is_alias(self)