Skip to content

Commit

Permalink
refactor(semantic): remove unneeded condition in PyPI version compara…
Browse files Browse the repository at this point in the history
…tor (#1362)

Currently this return is not covered because we're explicitly doing all
three possible comparisons, so we might as well move the equality check
to the end as the default
  • Loading branch information
G-Rath authored Oct 31, 2024
1 parent cc702c8 commit ffd2eb2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions internal/semantic/version-pypi.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,18 +225,14 @@ 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
}
if ai < bi {
return -1
}

return 0
return pv.pre.number.Cmp(pw.pre.number)
}
}

Expand Down

0 comments on commit ffd2eb2

Please sign in to comment.