summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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