summaryrefslogtreecommitdiffhomepage
path: root/libs/uci/luasrc/model
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-09-09 12:44:41 +0000
committerSteven Barth <steven@midlink.org>2008-09-09 12:44:41 +0000
commit8dbf29e86e984e9de87ad0724a99cab89f2d8ea6 (patch)
tree158b52a64bd1ac91e5dff563f939b18b5084af84 /libs/uci/luasrc/model
parent023b4ddf646438cfb0a468fdcb3a32945b239e20 (diff)
Performance optimisations:
In-line expressions are faster than function calls
Diffstat (limited to 'libs/uci/luasrc/model')
-rw-r--r--libs/uci/luasrc/model/uci.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/uci/luasrc/model/uci.lua b/libs/uci/luasrc/model/uci.lua
index 8852d1e5f..2385cc37c 100644
--- a/libs/uci/luasrc/model/uci.lua
+++ b/libs/uci/luasrc/model/uci.lua
@@ -88,7 +88,7 @@ function Cursor.delete_all(self, config, stype, comparator)
local function helper (section)
if not comparator or comparator(section) then
- table.insert(del, section[".name"])
+ del[#del+1] = section[".name"]
end
end
@@ -201,14 +201,14 @@ function Cursor._affected(self, configlist)
function(section)
if section.affects then
for i, aff in ipairs(section.affects) do
- table.insert(deps, aff)
+ deps[#deps+1] = aff
end
end
end)
for i, dep in ipairs(deps) do
for j, add in ipairs(_resolve_deps(dep)) do
- table.insert(reload, add)
+ reload[#reload+1] = add
end
end
@@ -219,7 +219,7 @@ function Cursor._affected(self, configlist)
for j, config in ipairs(configlist) do
for i, e in ipairs(_resolve_deps(config)) do
if not util.contains(reloadlist, e) then
- table.insert(reloadlist, e)
+ reloadlist[#reloadlist+1] = e
end
end
end