Comparison

util/cache.lua @ 11198:c4c06fbb7d87

util.cache: Add __name to metatable
author Matthew Wild <mwild1@gmail.com>
date Fri, 30 Oct 2020 14:05:07 +0000
parent 8398:3eff1b60269a
child 13174:8ec7b7d6556f
comparison
equal deleted inserted replaced
11197:50f182931bdd 11198:c4c06fbb7d87
26 end 26 end
27 list._count = list._count + 1; 27 list._count = list._count + 1;
28 end 28 end
29 29
30 local cache_methods = {}; 30 local cache_methods = {};
31 local cache_mt = { __index = cache_methods }; 31 local cache_mt = { __name = "cache", __index = cache_methods };
32 32
33 function cache_methods:set(k, v) 33 function cache_methods:set(k, v)
34 local m = self._data[k]; 34 local m = self._data[k];
35 if m then 35 if m then
36 -- Key already exists 36 -- Key already exists