From f787d8d90dd578435614fba028404c3c824cbbbf Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Fri, 1 Nov 2024 08:42:17 +1300 Subject: [PATCH] refactor(semantic): remove unneeded condition in PyPI version comparator (#274) --- pkg/semantic/version-pypi.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/semantic/version-pypi.go b/pkg/semantic/version-pypi.go index f89c7b34..b6fc922c 100644 --- a/pkg/semantic/version-pypi.go +++ b/pkg/semantic/version-pypi.go @@ -225,10 +225,6 @@ func (pv PyPIVersion) comparePre(pw PyPIVersion) int { ai := pv.preIndex() bi := pw.preIndex() - if ai == bi { - return pv.pre.number.Cmp(pw.pre.number) - } - if ai > bi { return +1 } @@ -236,7 +232,7 @@ func (pv PyPIVersion) comparePre(pw PyPIVersion) int { return -1 } - return 0 + return pv.pre.number.Cmp(pw.pre.number) } }