aboutsummaryrefslogtreecommitdiffstats
path: root/prog/heatmap.go
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 /prog/heatmap.go
parentf9e07a6e597b68d3397864e6ee4550f9065c3518 (diff)
all: use min/max functions
They are shorter, more readable, and don't require temp vars.
Diffstat (limited to 'prog/heatmap.go')
-rw-r--r--prog/heatmap.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/prog/heatmap.go b/prog/heatmap.go
index 2bfbceacc..5063d51ea 100644
--- a/prog/heatmap.go
+++ b/prog/heatmap.go
@@ -44,10 +44,7 @@ func (hm *GenericHeatmap) NumMutations() int {
// + up to 4 mutations at random so that even small images can get more than one.
n += hm.r.Intn(5)
// But don't do too many as it will most likely corrupt the image.
- if max := 10; n > max {
- n = max
- }
- return n
+ return min(n, 10)
}
func (hm *GenericHeatmap) ChooseLocation() int {