solvit: made version serializing reduce ranges that behave as one single version
it is possible that a range that gets generated could have the same exact version on both ends. if that happens, this small code will reduce it to one
This commit is contained in:
+10
-3
@@ -84,10 +84,17 @@ function avs.serializeSingle(ver)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function avs.serializeVersion(ver)
|
function avs.serializeVersion(ver)
|
||||||
out=""
|
local singles = {}
|
||||||
for i=1,#ver do
|
for i=1,#ver do
|
||||||
out=out..avs.serializeSingle(ver[i])
|
table.insert(singles,avs.serializeSingle(ver[i]))
|
||||||
if i~=#ver then
|
end
|
||||||
|
if singles[1]==singles[2] then
|
||||||
|
singles={singles[1]}
|
||||||
|
end
|
||||||
|
local out=""
|
||||||
|
for i=1,#singles do
|
||||||
|
out=out..singles[i]
|
||||||
|
if i~=#singles then
|
||||||
out=out.."-"
|
out=out.."-"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user