summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDarius <darius.joksas@teltonika.lt>2018-08-31 10:54:35 +0300
committerDarius <darius.joksas@teltonika.lt>2018-08-31 10:54:35 +0300
commit7222bdabd4c11c0955515b1f11b4367aab7132da (patch)
treeffe9fd288205d6a388ca858415fb1dbae2776dfd
parent1b2065d0be7f74cb93fac7f208ee4f28666d3f69 (diff)
luci-mod-admin-full: performance fix
* uci:get replaced with direct access of value (functions has 3x better performance in that way) Signed-off-by: Darius Joksas <jok.darius@gmail.com>
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua2
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua
index 06bce01fc4..8be354b448 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua
@@ -53,7 +53,7 @@ local function get_ifstate(name, option)
m.uci:foreach("luci", "ifstate", function (s)
if s.interface == name then
- val = m.uci:get("luci", s[".name"], option)
+ val = s[option]
return false
end
end)
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua
index 3e46628d3f..d79b3c4704 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua
@@ -17,7 +17,7 @@ local update_interfaces = function(old_ifname, new_ifname)
local info = { }
m.uci:foreach("network", "interface", function(section)
- local old_ifnames = m.uci:get("network", section[".name"], "ifname")
+ local old_ifnames = section.ifname
local new_ifnames = { }
local cur_ifname
local changed = false