From 72d51cee9b4b8c43539aa08e5c17a9ef5bc4e84b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 23 Nov 2022 21:54:56 +0100 Subject: [PATCH] perf: copy reason without deepcopy --- lua/lazy/core/loader.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lua/lazy/core/loader.lua b/lua/lazy/core/loader.lua index 48d6e28..d87c232 100644 --- a/lua/lazy/core/loader.lua +++ b/lua/lazy/core/loader.lua @@ -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() @@ -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 @@ -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