aboutsummaryrefslogtreecommitdiffstats
path: root/prog/target.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-05-17 11:18:15 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-05-18 11:34:42 +0200
commitba2826f39e64847f3250cf134b7a51b942eb3673 (patch)
tree7990192f05f381ce44ef7b4bdf083d665138b714 /prog/target.go
parent17b3eb97de1822644d1611efbfc9c7cd2dd7722c (diff)
prog: reduce number of allocations in Mutate
Don't allocate 3 parallel slices.
Diffstat (limited to 'prog/target.go')
-rw-r--r--prog/target.go3
1 files changed, 1 insertions, 2 deletions
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