Skip to content

Commit 5d5c211

Browse files
committed
refactor(semantic): optimize loop exit condition
1 parent df3c63b commit 5d5c211

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

.golangci.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ linters:
3434
- pkg: regexp
3535
desc:
3636
Use github.com/g-rath/osv-detector/internal/cachedregexp instead
37-
staticcheck:
38-
checks:
39-
- all
40-
- -QF1006 # lift into loop condition
4137
exclusions:
4238
generated: lax
4339
presets:

pkg/semantic/version-debian.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ func compareDebianVersions(a, b string) int {
7777
var adp, bdp *big.Int
7878

7979
// based off: https://man7.org/linux/man-pages/man7/deb-version.7.html
80-
for {
81-
if a == "" && b == "" {
82-
break
83-
}
84-
80+
for a != "" || b != "" {
8581
ap, a = splitDebianNonDigitPrefix(a)
8682
bp, b = splitDebianNonDigitPrefix(b)
8783

0 commit comments

Comments
 (0)