Skip to content

Commit 835516b

Browse files
committed
[优化] 取配置放到循环外
1 parent 791e8fe commit 835516b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

script/vm/type.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ end
615615
---@return vm.node?
616616
function vm.getTableValue(uri, tnode, knode, inversion)
617617
local result = vm.createNode()
618+
local inferSize = config.get(uri, "Lua.type.inferTableSize")
618619
for tn in tnode:eachObject() do
619620
if tn.type == 'doc.type.table' then
620621
for _, field in ipairs(tn.fields) do
@@ -655,7 +656,6 @@ function vm.getTableValue(uri, tnode, knode, inversion)
655656
end
656657
end
657658
end
658-
local inferSize = config.get(uri, "Lua.type.inferTableSize")
659659
if field.type == 'tableexp'
660660
and field.value
661661
and field.tindex <= inferSize then

0 commit comments

Comments
 (0)