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 dec25a5d0b8a3f72bd07187c0a0fef2604e19fa4..67a2de4ed2105a4854b024349c6ac4b1b2de1733 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)