From 868b07f1299cce15bf6475456777d05a8b254b65 Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Thu, 12 Feb 2015 13:46:49 +0200 Subject: model: remove fetch cache --- aconf/model/node.lua | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'aconf') 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 -- cgit v1.2.3