mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
perf(plugin): de-duplicate dependencies, keys, ft, event and cmd
This commit is contained in:
parent
da4e8cc245
commit
1b2a6f631c
2 changed files with 19 additions and 2 deletions
|
@ -222,6 +222,23 @@ function M.lsmod(modname, fn)
|
|||
end)
|
||||
end
|
||||
|
||||
---@generic T
|
||||
---@param list T[]
|
||||
---@param add T[]
|
||||
---@return T[]
|
||||
function M.extend(list, add)
|
||||
local idx = {}
|
||||
for _, v in ipairs(list) do
|
||||
idx[v] = v
|
||||
end
|
||||
for _, a in ipairs(add) do
|
||||
if not idx[a] then
|
||||
table.insert(list, a)
|
||||
end
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
||||
---@alias LazyNotifyOpts {lang?:string, title?:string, level?:number}
|
||||
|
||||
---@param msg string|string[]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue