libs/uci: Optimized workaround
authorSteven Barth <steven@midlink.org>
Tue, 2 Sep 2008 09:02:20 +0000 (09:02 +0000)
committerSteven Barth <steven@midlink.org>
Tue, 2 Sep 2008 09:02:20 +0000 (09:02 +0000)
libs/uci/luasrc/model/uci.lua

index e26f9030adb0dac848a494e3dbfc508a79dc5a8a..82c76ced2a2dcd6f455cfafbb974cc8f0f3aff16 100644 (file)
@@ -153,12 +153,14 @@ function Cursor.changes(self, config)
        if config then
                return Cursor._changes(self, config)
        else
-               local changes = {}
-               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))
+               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
+               end)
                return changes
        end
 end