Skip to content

Commit

Permalink
perf: copy reason without deepcopy
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 23, 2022
1 parent c046b1f commit 72d51ce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lua/lazy/core/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function M.init_plugins()
Util.track()
end
if plugin.opt == false then
M.load(plugin, { package = "start" })
M.load(plugin, { start = "start" })
end
end
Util.track()
Expand Down Expand Up @@ -183,7 +183,6 @@ function M.module(modname)
end
end
M.load(plugins, reason)
-- M.loaders.module[name] = nil
end
idx = modname:find(".", idx + 1, true)
end
Expand Down Expand Up @@ -212,7 +211,10 @@ function M.load(plugins, reason)
end

if not plugin.loaded then
plugin.loaded = vim.deepcopy(reason or {})
plugin.loaded = {}
for k, v in pairs(reason) do
plugin.loaded[k] = v
end
if #M.loading > 0 then
plugin.loaded.plugin = M.loading[#M.loading].name
end
Expand Down

0 comments on commit 72d51ce

Please sign in to comment.