Bump UCI version
[project/luci.git] / libs / uci / luasrc / model / uci.lua
index 8852d1e..ecb8f47 100644 (file)
@@ -77,7 +77,7 @@ function Cursor.delete_all(self, config, stype, comparator)
                local tbl = comparator
                comparator = function(section)
                        for k, v in pairs(tbl) do
-                               if not section[k] == v then
+                               if section[k] ~= v then
                                        return false
                                end
                        end 
@@ -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
 
@@ -164,25 +164,6 @@ function Cursor.set_list(self, config, section, option, value)
        return false
 end
 
-
-Cursor._changes = Cursor.changes
-function Cursor.changes(self, config)
-       if config then
-               return Cursor._changes(self, config)
-       else
-               local changes = Cursor._changes(self)
-               util.copcall(function()
-                       for k,v in pairs(require "luci.fs".dir(self:get_savedir())) do
-                               if v ~= "." and v ~= ".." then
-                                       util.update(changes, Cursor._changes(self, v))
-                               end
-                       end
-               end)
-               return changes
-       end
-end
-
-
 -- Return a list of initscripts affected by configuration changes.
 function Cursor._affected(self, configlist)
        configlist = type(configlist) == "table" and configlist or {configlist}
@@ -201,14 +182,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 +200,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