mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
perf(vim.fs.normalize): use iterator
~10% faster.
This commit is contained in:
parent
dcdefd0428
commit
14a5813c20
@ -455,11 +455,9 @@ end
|
||||
--- @return string Resolved path.
|
||||
local function path_resolve_dot(path)
|
||||
local is_path_absolute = vim.startswith(path, '/')
|
||||
-- Split the path into components and process them
|
||||
local path_components = vim.split(path, '/')
|
||||
local new_path_components = {}
|
||||
|
||||
for _, component in ipairs(path_components) do
|
||||
for component in vim.gsplit(path, '/') do
|
||||
if component == '.' or component == '' then -- luacheck: ignore 542
|
||||
-- Skip `.` components and empty components
|
||||
elseif component == '..' then
|
||||
|
Loading…
Reference in New Issue
Block a user