Skip to content

Commit 72d51ce

Browse files
committed
perf: copy reason without deepcopy
1 parent c046b1f commit 72d51ce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lua/lazy/core/loader.lua

+5-3
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function M.init_plugins()
154154
Util.track()
155155
end
156156
if plugin.opt == false then
157-
M.load(plugin, { package = "start" })
157+
M.load(plugin, { start = "start" })
158158
end
159159
end
160160
Util.track()
@@ -183,7 +183,6 @@ function M.module(modname)
183183
end
184184
end
185185
M.load(plugins, reason)
186-
-- M.loaders.module[name] = nil
187186
end
188187
idx = modname:find(".", idx + 1, true)
189188
end
@@ -212,7 +211,10 @@ function M.load(plugins, reason)
212211
end
213212

214213
if not plugin.loaded then
215-
plugin.loaded = vim.deepcopy(reason or {})
214+
plugin.loaded = {}
215+
for k, v in pairs(reason) do
216+
plugin.loaded[k] = v
217+
end
216218
if #M.loading > 0 then
217219
plugin.loaded.plugin = M.loading[#M.loading].name
218220
end

0 commit comments

Comments
 (0)