Skip to content

Commit 1fad42a

Browse files
committed
chore(model): Remove IVY_VERSION_RANGE_INDICATORS
These are by now only used for an early return from `getVersionRange()`. As checking for a valid range is done by the `RangesListFactory`, the only remaining case to check for is the empty string, which would otherwise create a ">= 0.0.0" range. Note that as of 8142cdc the variable name was misleading anyway, as it does not only contain Ivy version range indicators. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent cd3bc07 commit 1fad42a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

model/src/main/kotlin/utils/VersionUtils.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ import org.semver4j.RangesList
2727
import org.semver4j.RangesListFactory
2828
import org.semver4j.Semver
2929

30-
/**
31-
* A list of Strings that are used by Ivy-style version ranges.
32-
*/
33-
private val IVY_VERSION_RANGE_INDICATORS = listOf(",", "~", "*", "+", ">", "<", "=", " - ", "^", ".x", "||")
34-
3530
/**
3631
* Return true if the version of this [Identifier] interpreted as an Ivy version matcher is applicable to the
3732
* package with the given [identifier][pkgId].
@@ -66,7 +61,7 @@ internal fun Identifier.isVersionRange(): Boolean {
6661
}
6762

6863
private fun Identifier.getVersionRanges(): RangesList? {
69-
if (IVY_VERSION_RANGE_INDICATORS.none { version.contains(it, ignoreCase = true) }) return null
64+
if (version.isEmpty()) return null
7065

7166
return runCatching {
7267
RangesListFactory.create(version).takeUnless { it.get().isEmpty() }

0 commit comments

Comments
 (0)