Skip to content

Commit

Permalink
[优化] 取配置放到循环外
Browse files Browse the repository at this point in the history
  • Loading branch information
Rcklos committed Nov 5, 2024
1 parent 791e8fe commit 835516b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion script/vm/type.lua
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ end
---@return vm.node?
function vm.getTableValue(uri, tnode, knode, inversion)
local result = vm.createNode()
local inferSize = config.get(uri, "Lua.type.inferTableSize")
for tn in tnode:eachObject() do
if tn.type == 'doc.type.table' then
for _, field in ipairs(tn.fields) do
Expand Down Expand Up @@ -655,7 +656,6 @@ function vm.getTableValue(uri, tnode, knode, inversion)
end
end
end
local inferSize = config.get(uri, "Lua.type.inferTableSize")
if field.type == 'tableexp'
and field.value
and field.tindex <= inferSize then
Expand Down

0 comments on commit 835516b

Please sign in to comment.