aboutsummaryrefslogtreecommitdiffstats
path: root/sys/targets
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 /sys/targets
parentf9e07a6e597b68d3397864e6ee4550f9065c3518 (diff)
all: use min/max functions
They are shorter, more readable, and don't require temp vars.
Diffstat (limited to 'sys/targets')
-rw-r--r--sys/targets/targets.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index fa2f6f0e2..c571d1165 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -825,10 +825,7 @@ func (target *Target) Timeouts(slowdown int) Timeouts {
}
timeouts := target.timeouts
timeouts.Slowdown = slowdown
- timeouts.Scale = time.Duration(slowdown)
- if timeouts.Scale > 3 {
- timeouts.Scale = 3
- }
+ timeouts.Scale = min(time.Duration(slowdown), 3)
if timeouts.Syscall == 0 {
timeouts.Syscall = 50 * time.Millisecond
}