Skip to content

Commit 8081c73

Browse files
committed
small project info cache optimization
1 parent 451ba91 commit 8081c73

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lua/neotest-vstest/dotnet_utils.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,17 @@ function dotnet_utils.get_proj_info(path)
146146
end
147147
end
148148

149-
local semaphore
150-
151149
if not proj_file then
152150
return nil
153151
end
154152

153+
--- Simple check before acquiring the semaphore to avoid unnecessary waits.
154+
if proj_info_cache[proj_file] then
155+
return proj_info_cache[proj_file]
156+
end
157+
158+
local semaphore
159+
155160
if project_semaphore[proj_file] then
156161
semaphore = project_semaphore[proj_file]
157162
else

0 commit comments

Comments
 (0)