summaryrefslogtreecommitdiff
path: root/script-beta/vm/eachField.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-10-29 20:58:47 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-10-29 20:58:47 +0800
commit2620918840cb28fdd641fa986367ad9e8175a730 (patch)
tree7c1665dfae55d9c9bc3b3778271fd7b76093eb87 /script-beta/vm/eachField.lua
parentd5ecec7f362db69879e5097e41bd334d76260783 (diff)
downloadlua-language-server-2620918840cb28fdd641fa986367ad9e8175a730.zip
优化性能
Diffstat (limited to 'script-beta/vm/eachField.lua')
-rw-r--r--script-beta/vm/eachField.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/script-beta/vm/eachField.lua b/script-beta/vm/eachField.lua
index 90892f03..798566b4 100644
--- a/script-beta/vm/eachField.lua
+++ b/script-beta/vm/eachField.lua
@@ -47,12 +47,16 @@ local function eachField(source, deep)
end
function vm.getFields(source, deep)
+ if ALL_DEEP then
+ deep = 'deep'
+ end
if guide.isGlobal(source) then
local name = guide.getKeyName(source)
local cache = vm.getCache('eachFieldOfGlobal')[name]
or vm.getCache('eachField')[source]
or eachField(source, 'deep')
vm.getCache('eachFieldOfGlobal')[name] = cache
+ vm.getCache('eachField')[source] = cache
return cache
else
local cache = vm.getCache('eachField')[source]