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 /pkg/instance/instance.go | |
| parent | f9e07a6e597b68d3397864e6ee4550f9065c3518 (diff) | |
all: use min/max functions
They are shorter, more readable, and don't require temp vars.
Diffstat (limited to 'pkg/instance/instance.go')
| -rw-r--r-- | pkg/instance/instance.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index f2f024216..411568e65 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -273,9 +273,7 @@ func (env *env) Test(numVMs int, reproSyz, reproOpts, reproC []byte) ([]EnvTestR return nil, fmt.Errorf("failed to create VM pool: %w", err) } defer vmPool.Close() - if n := vmPool.Count(); numVMs > n { - numVMs = n - } + numVMs = min(numVMs, vmPool.Count()) res := make(chan EnvTestResult, numVMs) for i := 0; i < numVMs; i++ { inst := &inst{ |
