mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-20 05:16:45 +00:00
perf: cache handler groups
This commit is contained in:
parent
05a0da532b
commit
42c2fb42c8
3 changed files with 40 additions and 40 deletions
|
@ -8,19 +8,13 @@ M.loading = {}
|
|||
|
||||
function M.setup()
|
||||
local Handler = require("lazy.core.handler")
|
||||
local groups = Handler.group(Config.plugins)
|
||||
for t, handler in pairs(Handler.handlers) do
|
||||
Util.track(t)
|
||||
---@type LazyPlugin[]
|
||||
local plugins = {}
|
||||
for _, plugin in pairs(Config.plugins) do
|
||||
if plugin[t] ~= nil then
|
||||
table.insert(plugins, plugin)
|
||||
end
|
||||
if groups[t] then
|
||||
Util.track(t)
|
||||
handler(groups[t])
|
||||
Util.track()
|
||||
end
|
||||
if #plugins > 0 then
|
||||
handler(plugins)
|
||||
end
|
||||
Util.track()
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue