summaryrefslogtreecommitdiffstats
path: root/aconf
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2015-02-12 13:46:49 +0200
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2015-02-12 16:32:41 +0200
commit868b07f1299cce15bf6475456777d05a8b254b65 (patch)
tree2322e0f3c3b01276989307baf2d1d5f354641798 /aconf
parent29282b5a7d43e8b5ce12b0ec4b7a7620c19a67b6 (diff)
downloadaconf-868b07f1299cce15bf6475456777d05a8b254b65.tar.bz2
aconf-868b07f1299cce15bf6475456777d05a8b254b65.tar.xz
model: remove fetch cache
Diffstat (limited to 'aconf')
-rw-r--r--aconf/model/node.lua13
1 files changed, 3 insertions, 10 deletions
diff --git a/aconf/model/node.lua b/aconf/model/node.lua
index 21b3ec2..2a4687c 100644
--- a/aconf/model/node.lua
+++ b/aconf/model/node.lua
@@ -123,20 +123,13 @@ function M.TreeNode:init(context, params)
return getmetatable(next)._fetch(path, create)
end
- local cache = {}
-
function mt.fetch(path, create)
- local res = cache[path]
- if res then return res end
-
if pth.is_absolute(path) and mt.path > '/' then
assert(not create)
- res = mt.txn:fetch(path, mt.privileged)
-
- else res = mt._fetch(pth.split(path), create) end
+ return mt.txn:fetch(path, mt.privileged)
+ end
- if isinstance(res, M.TreeNode) then cache[path] = res end
- return res
+ return mt._fetch(pth.split(path), create)
end