diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/cache.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/util/cache.lua b/util/cache.lua index 9453697c..32670751 100644 --- a/util/cache.lua +++ b/util/cache.lua @@ -2,6 +2,8 @@ local cache_methods = {}; local cache_mt = { __index = cache_methods }; local function new(size) + size = assert(tonumber(size), "cache size must be a number"); + size = math.floor(size); assert(size > 0, "cache size must be greater than zero"); local data = {}; return setmetatable({ data = data, count = 0, size = size, head = nil, tail = nil }, cache_mt); |