diff --git a/cron.lua b/cron.lua index de0a823..0dc2fa9 100644 --- a/cron.lua +++ b/cron.lua @@ -109,7 +109,7 @@ local function storeScopeInCache(scope) local node = scopeCacheRoot for i=1, scope.len do local tag = scope.tags[i] - node.children[tag] = node.children[tag] or { children={} } + node.children[tag] = node.children[tag] or { children=setmetatable({},{__mode='k'}) } node = node.children[tag] end node.scope = scope @@ -165,7 +165,7 @@ end function cron.reset() entries = {} taggedEntries = setmetatable({}, {__mode='k'}) - scopeCacheRoot = { children = {}} + scopeCacheRoot = { children = setmetatable({}, {__mode='k'}) } end -- tagged functions diff --git a/spec/cron_spec.lua b/spec/cron_spec.lua index 98eeb49..9b7287e 100644 --- a/spec/cron_spec.lua +++ b/spec/cron_spec.lua @@ -159,8 +159,5 @@ describe( 'cron', function() assert_equal(counter, 4) end) - it('caches scopes', function() - assert_equal(cron.tagged('hello', 'world'), cron.tagged('hello', 'world')) - end) end) end)