diff options
Diffstat (limited to 'acf/persistence/backends/volatile.lua')
-rw-r--r-- | acf/persistence/backends/volatile.lua | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/acf/persistence/backends/volatile.lua b/acf/persistence/backends/volatile.lua index 339f937..7322323 100644 --- a/acf/persistence/backends/volatile.lua +++ b/acf/persistence/backends/volatile.lua @@ -5,14 +5,7 @@ See LICENSE file for license details module(..., package.seeall) -local copy = require('acf.util').copy - - -local function keys(tbl) - local res = {} - for k, v in pairs(tbl) do table.insert(res, k) end - return res -end +local util = require('acf.util') backend = require('acf.object').class() @@ -31,7 +24,7 @@ end function backend:get(path, tpe) local res = self:_get(path) - return type(res) == 'table' and keys(res) or res + return type(res) == 'table' and util.keys(res) or res end function backend:_set(path, tpe, value) @@ -40,7 +33,7 @@ function backend:_set(path, tpe, value) if #path == 0 then self.data = value else - local comps = copy(path) + local comps = util.copy(path) local name = comps[#comps] table.remove(comps) self:_get(comps)[name] = value |