aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2025-01-17 10:28:16 +0100
committerDmitry Vyukov <dvyukov@google.com>2025-01-17 10:02:07 +0000
commit5d04aae8969f6c72318ce0a4cde4f027766b1a55 (patch)
tree8f1b632847c431407090f0fe1335522ff2195a37 /pkg/vcs
parentf9e07a6e597b68d3397864e6ee4550f9065c3518 (diff)
all: use min/max functions
They are shorter, more readable, and don't require temp vars.
Diffstat (limited to 'pkg/vcs')
-rw-r--r--pkg/vcs/linux.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/pkg/vcs/linux.go b/pkg/vcs/linux.go
index d348dd71e..c0b96aaa4 100644
--- a/pkg/vcs/linux.go
+++ b/pkg/vcs/linux.go
@@ -109,9 +109,7 @@ func gitReleaseTagToInt(tag string, includeRC bool) uint64 {
if v1 < 0 {
return 0
}
- if v3 < 0 {
- v3 = 0
- }
+ v3 = max(v3, 0)
if rc >= 0 {
if !includeRC {
return 0