From 09cd9882be4b66f270c74516759844683832b1d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 28 Jun 2022 16:34:56 +0800 Subject: typo --- script/proto/diagnostic.lua | 2 +- script/utility.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'script') diff --git a/script/proto/diagnostic.lua b/script/proto/diagnostic.lua index 25f187db..43043b94 100644 --- a/script/proto/diagnostic.lua +++ b/script/proto/diagnostic.lua @@ -224,7 +224,7 @@ end ---@param name string ---@return string[] -m.getGroups = util.catchReturn(function (name) +m.getGroups = util.cacheReturn(function (name) local groups = {} for groupName, nameMap in pairs(m.diagnosticGroups) do if nameMap[name] then diff --git a/script/utility.lua b/script/utility.lua index a72714f1..034f19d5 100644 --- a/script/utility.lua +++ b/script/utility.lua @@ -835,7 +835,7 @@ m.MODE_KV = { __mode = 'kv' } ---@generic T: fun(param: any):any ---@param func T ---@return T -function m.catchReturn(func) +function m.cacheReturn(func) local cache = {} return function (param) if cache[param] == nil then -- cgit v1.2.3