Skip to content

Commit 3521c2f

Browse files
committed
replace with vim.split
1 parent 7f9729e commit 3521c2f

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

lua/crates/semver.lua

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,6 @@ function M.compare_pre(version, req)
223223
return -1
224224
end
225225

226-
---@param str string
227-
---@return string[]
228-
local function split_identifiers(str)
229-
local parts = {}
230-
for part in str:gmatch("[^%.]+") do
231-
table.insert(parts, part)
232-
end
233-
return parts
234-
end
235-
236226
---@param str string
237227
---@return boolean
238228
local function is_numeric(str)
@@ -258,8 +248,8 @@ function M.compare_pre(version, req)
258248
end
259249
end
260250

261-
local version_parts = version and split_identifiers(version) or {}
262-
local req_parts = req and split_identifiers(req) or {}
251+
local version_parts = version and vim.split(version, ".") or {}
252+
local req_parts = req and vim.split(req, ".") or {}
263253

264254
local max_len = math.max(#version_parts, #req_parts)
265255

0 commit comments

Comments
 (0)