From ba2826f39e64847f3250cf134b7a51b942eb3673 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 17 May 2020 11:18:15 +0200 Subject: prog: reduce number of allocations in Mutate Don't allocate 3 parallel slices. --- prog/target.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'prog/target.go') diff --git a/prog/target.go b/prog/target.go index f19ed3fa2..23d1ebd08 100644 --- a/prog/target.go +++ b/prog/target.go @@ -275,8 +275,7 @@ func (g *Gen) MutateArg(arg0 Arg) (calls []*Call) { // and updateSizes to caller so that Mutate can act accordingly. return } - idx := g.r.Intn(len(ma.args)) - arg, ctx := ma.args[idx], ma.ctxes[idx] + arg, ctx := ma.chooseArg(g.r.Rand) newCalls, ok := g.r.target.mutateArg(g.r, g.s, arg, ctx, &updateSizes) if !ok { continue -- cgit mrf-deployment