summaryrefslogtreecommitdiffstats
path: root/aconf/persistence/backends/augeas.lua
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-04-15 22:59:21 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-04-15 22:59:21 +0300
commitd9decd5a0dd0abbe7842da4400e665d96d6b8f9b (patch)
tree27a1807e9f8d1fa69b4ba0f0a2f2b5080906a825 /aconf/persistence/backends/augeas.lua
parent909197f81d7cc47f6bfbaed39727c59245584bbb (diff)
downloadaconf-d9decd5a0dd0abbe7842da4400e665d96d6b8f9b.tar.bz2
aconf-d9decd5a0dd0abbe7842da4400e665d96d6b8f9b.tar.xz
use 'unpack' function from 'table' module
Diffstat (limited to 'aconf/persistence/backends/augeas.lua')
-rw-r--r--aconf/persistence/backends/augeas.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/aconf/persistence/backends/augeas.lua b/aconf/persistence/backends/augeas.lua
index a448e65..7ffccb9 100644
--- a/aconf/persistence/backends/augeas.lua
+++ b/aconf/persistence/backends/augeas.lua
@@ -161,7 +161,7 @@ function backend:set(mods)
local gc = {}
for _, mod in ipairs(mods) do
- local path, value = unpack(mod)
+ local path, value = table.unpack(mod)
local function insert(path, new)
local apath, mode, keys = conv_path(path)
@@ -173,7 +173,7 @@ function backend:set(mods)
local ppath, pmode = conv_path(parent)
if pmode then
- gc[pth.join(unpack(array_without_last(parent)))] = false
+ gc[pth.join(table.unpack(array_without_last(parent)))] = false
end
if pmode == '#' then
@@ -239,7 +239,7 @@ function backend:set(mods)
self.aug:set(apath, value ~= nil and tostr(value) or nil)
end
- util.setdefault(gc, pth.join(unpack(path)), true)
+ util.setdefault(gc, pth.join(table.unpack(path)), true)
end
for path, _ in pairs(gc) do
@@ -255,7 +255,9 @@ function backend:set(mods)
break
end
- if gc[pth.join(unpack(p))] ~= false then self.aug:rm(conv_path(p)) end
+ if gc[pth.join(table.unpack(p))] ~= false then
+ self.aug:rm(conv_path(p))
+ end
p[#p] = nil
end
end