diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2025-01-17 10:28:16 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2025-01-17 10:02:07 +0000 |
| commit | 5d04aae8969f6c72318ce0a4cde4f027766b1a55 (patch) | |
| tree | 8f1b632847c431407090f0fe1335522ff2195a37 /sys/openbsd | |
| parent | f9e07a6e597b68d3397864e6ee4550f9065c3518 (diff) | |
all: use min/max functions
They are shorter, more readable, and don't require temp vars.
Diffstat (limited to 'sys/openbsd')
| -rw-r--r-- | sys/openbsd/init.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/openbsd/init.go b/sys/openbsd/init.go index 2a2aeae4c..5d0c3a77c 100644 --- a/sys/openbsd/init.go +++ b/sys/openbsd/init.go @@ -196,12 +196,8 @@ func (arch *arch) neutralizeRlimit(c *prog.Call) { for _, arg := range args { switch v := arg.(type) { case *prog.ConstArg: - if v.Val < rlimitMin { - v.Val = rlimitMin - } - if v.Val > rlimitMax { - v.Val = rlimitMax - } + v.Val = max(v.Val, rlimitMin) + v.Val = min(v.Val, rlimitMax) } } } |
