From 5d04aae8969f6c72318ce0a4cde4f027766b1a55 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 17 Jan 2025 10:28:16 +0100 Subject: all: use min/max functions They are shorter, more readable, and don't require temp vars. --- prog/heatmap.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'prog/heatmap.go') 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 { -- cgit mrf-deployment