diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-08-01 19:24:21 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-08-02 16:57:31 +0200 |
| commit | c8643744fe4be55e516f7ba494777016abc1055e (patch) | |
| tree | c2fe83e2b312132562189b59997b4fbdb1699772 /prog/minimization.go | |
| parent | e002278dfb76b3d01fc860997f08ad71c022d1c7 (diff) | |
prog: refactor defaultArg/isDefaultArg
Refactor from single-big-switch to type methods.
Update #538
Diffstat (limited to 'prog/minimization.go')
| -rw-r--r-- | prog/minimization.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/prog/minimization.go b/prog/minimization.go index 1943ef4ea..021d8e2ea 100644 --- a/prog/minimization.go +++ b/prog/minimization.go @@ -178,12 +178,12 @@ func minimizeInt(ctx *minimizeArgsCtx, arg Arg, path string) bool { return false } a := arg.(*ConstArg) - def := arg.Type().Default() - if a.Val == def { + def := arg.Type().makeDefaultArg().(*ConstArg) + if a.Val == def.Val { return false } v0 := a.Val - a.Val = def + a.Val = def.Val if ctx.pred(ctx.p, ctx.callIndex0) { *ctx.p0 = ctx.p } else { |
