summaryrefslogtreecommitdiff
path: root/script-beta/parser/guide.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-10-22 17:36:25 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-10-22 17:36:25 +0800
commitd2328cf547e6bac9c87cf9bf61709380fe950496 (patch)
treef7cd5e1888f98bae5b43ad35730bae2c22147837 /script-beta/parser/guide.lua
parent440e301d144f4fe85785f27d2fa6af2d57688930 (diff)
downloadlua-language-server-d2328cf547e6bac9c87cf9bf61709380fe950496.zip
修正一处性能问题
Diffstat (limited to 'script-beta/parser/guide.lua')
-rw-r--r--script-beta/parser/guide.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index ef4f768c..309bc565 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -1548,6 +1548,7 @@ function m.checkSameSimpleInCallInSameFile(status, func, args, index)
local newStatus = m.status(status)
m.searchRefs(newStatus, func, 'def')
local results = {}
+ local mark = {}
for _, def in ipairs(newStatus.results) do
local value = m.getObjectValue(def) or def
if value.type == 'function' then
@@ -1555,7 +1556,8 @@ function m.checkSameSimpleInCallInSameFile(status, func, args, index)
if returns then
for _, ret in ipairs(returns) do
local exp = ret[index]
- if exp then
+ if exp and not mark[exp] then
+ mark[exp] = true
results[#results+1] = exp
end
end
@@ -1566,9 +1568,6 @@ function m.checkSameSimpleInCallInSameFile(status, func, args, index)
end
function m.checkSameSimpleInCall(status, ref, start, queue, mode)
- if status.simple then
- return
- end
local func, args, index = m.getCallValue(ref)
if not func then
return