From 4bb80e039198ceb2e45bb51d46d7013eacc8f452 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 17 Jun 2021 10:40:03 +0200 Subject: perf: searchSameFields: return early when obj was already locked --- script/core/guide.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'script') diff --git a/script/core/guide.lua b/script/core/guide.lua index e4871060..c7a784b7 100644 --- a/script/core/guide.lua +++ b/script/core/guide.lua @@ -3016,7 +3016,7 @@ function m.searchSameFields(status, simple, mode) locks[start] = lock end if lock[obj] then - return + return false end lock[obj] = true queueLen = queueLen + 1 @@ -3032,13 +3032,17 @@ function m.searchSameFields(status, simple, mode) forces[queueLen] = force end end + return true end local function pushQueue(obj, start, force) if obj.type == 'getlocal' or obj.type == 'setlocal' then obj = obj.node end - appendQueue(obj, start, force) + if appendQueue(obj, start, force) == false then + -- no need to process the rest if obj is already locked + return + end if obj.type == 'local' and obj.ref then for _, ref in ipairs(obj.ref) do appendQueue(ref, start, force) -- cgit v1.2.3 From 6a26535292674b2cfb683b8b66425b5a79caf4e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 17 Jun 2021 17:09:41 +0800 Subject: disable `runtime.plugin` by default --- script/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'script') diff --git a/script/config.lua b/script/config.lua index 97df7c17..50aab037 100644 --- a/script/config.lua +++ b/script/config.lua @@ -131,7 +131,7 @@ local ConfigTemplate = { meta = {'${version} ${language}', String}, unicodeName = {false, Boolean}, nonstandardSymbol = {{}, Str2Hash ';'}, - plugin = {'.vscode/lua/plugin.lua', String}, + plugin = {'', String}, fileEncoding = {'utf8', String}, builtin = {{}, Hash(String, String)}, }, -- cgit v1.2.3