aboutsummaryrefslogtreecommitdiffstats
path: root/services/packages/arch
diff options
context:
space:
mode:
Diffstat (limited to 'services/packages/arch')
-rw-r--r--services/packages/arch/vercmp.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/services/packages/arch/vercmp.go b/services/packages/arch/vercmp.go
index 0d33dda0f1..d44aa530f0 100644
--- a/services/packages/arch/vercmp.go
+++ b/services/packages/arch/vercmp.go
@@ -34,13 +34,8 @@ func parseEVR(evr string) (epoch, version, release string) {
func compareSegments(a, b []string) int {
lenA, lenB := len(a), len(b)
- var l int
- if lenA > lenB {
- l = lenB
- } else {
- l = lenA
- }
- for i := 0; i < l; i++ {
+ l := min(lenA, lenB)
+ for i := range l {
if r := compare(a[i], b[i]); r != 0 {
return r
}