diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-19 15:51:13 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-19 15:51:13 +0800 |
commit | b841b2668dd7d36cbf42c3f261e69e2a70358c6b (patch) | |
tree | 83118b6ff32fd1b93b21605e2494dc6da8144b14 /script-beta/vm/getGlobals.lua | |
parent | 2c07a7a12bf840e1a90abc117fd5e69866f76fdb (diff) | |
download | lua-language-server-b841b2668dd7d36cbf42c3f261e69e2a70358c6b.zip |
优化全局性能
Diffstat (limited to 'script-beta/vm/getGlobals.lua')
-rw-r--r-- | script-beta/vm/getGlobals.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/script-beta/vm/getGlobals.lua b/script-beta/vm/getGlobals.lua index 9d51ec31..e5165130 100644 --- a/script-beta/vm/getGlobals.lua +++ b/script-beta/vm/getGlobals.lua @@ -96,18 +96,18 @@ function vm.getGlobals(key) return cache end -function vm.getGlobalSets(name) - local cache = vm.getCache('getGlobalSets')[name] +function vm.getGlobalSets(key) + local cache = vm.getCache('getGlobalSets')[key] if cache ~= nil then return cache end cache = {} - local refs = getGlobals(name) + local refs = getGlobals(key) for _, source in ipairs(refs) do if vm.isSet(source) then cache[#cache+1] = source end end - vm.getCache('getGlobalSets')[name] = cache + vm.getCache('getGlobalSets')[key] = cache return cache end |