From 7222bdabd4c11c0955515b1f11b4367aab7132da Mon Sep 17 00:00:00 2001 From: Darius Date: Fri, 31 Aug 2018 10:54:35 +0300 Subject: [PATCH] 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 --- .../luasrc/model/cbi/admin_network/ifaces.lua | 2 +- .../luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua | 2 +- 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 06bce01fc..8be354b44 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 3e46628d3..d79b3c470 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 -- 2.25.1