diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-01 10:49:34 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-01 10:49:34 +0800 |
commit | 58815ee05b636efe9330cd26926f4aeb047984a9 (patch) | |
tree | 27de6c7971606436048577d9f6b58f9a203d7389 /script | |
parent | 8e41f1d067e3ce5f77bc9fe7c03d404da5553c60 (diff) | |
download | lua-language-server-58815ee05b636efe9330cd26926f4aeb047984a9.zip |
clean up code
Diffstat (limited to 'script')
-rw-r--r-- | script/parser/guide.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 1b4213b1..54841333 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -1179,12 +1179,9 @@ function m.status(parentStatus, interface, deep) depth = parentStatus and (parentStatus.depth + 1) or 0, searchDeep= parentStatus and parentStatus.searchDeep or deep or -999, interface = parentStatus and parentStatus.interface or {}, - locks = parentStatus and parentStatus.locks or {}, deep = parentStatus and parentStatus.deep, results = {}, } - status.lock = status.locks[status.depth] or {} - status.locks[status.depth] = status.lock if interface then for k, v in pairs(interface) do status.interface[k] = v @@ -2297,13 +2294,14 @@ function m.searchSameFields(status, simple, mode) } end local max = 0 + local lock = {} for i = 1, 1e6 do local data = queue[i] if not data then return end - if not status.lock[data.obj] then - status.lock[data.obj] = true + if not lock[data.obj] then + lock[data.obj] = true max = max + 1 status.cache.count = status.cache.count + 1 m.checkSameSimple(status, simple, data, mode, queue) |