aboutsummaryrefslogtreecommitdiffstats
path: root/prog/minimization.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-03-08 18:48:26 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-03-08 18:48:26 +0100
commit36d1c4540af3ef058d68092e41af05aa4a8c5eca (patch)
tree3657a5920e4b100749ccb9d2d555652e7b7e28e9 /prog/minimization.go
parent63ef857906766b3cafe4aebc43bc38edf42096c3 (diff)
all: fix gometalinter warnings
Fix typos, non-canonical code, remove dead code, etc.
Diffstat (limited to 'prog/minimization.go')
-rw-r--r--prog/minimization.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/prog/minimization.go b/prog/minimization.go
index ea5072c97..8f2cbae61 100644
--- a/prog/minimization.go
+++ b/prog/minimization.go
@@ -9,7 +9,7 @@ import (
// Minimize minimizes program p into an equivalent program using the equivalence
// predicate pred. It iteratively generates simpler programs and asks pred
-// whether it is equal to the orginal program or not. If it is equivalent then
+// whether it is equal to the original program or not. If it is equivalent then
// the simplification attempt is committed and the process continues.
func Minimize(p0 *Prog, callIndex0 int, crash bool, pred0 func(*Prog, int) bool) (*Prog, int) {
pred := pred0
@@ -119,9 +119,8 @@ func Minimize(p0 *Prog, callIndex0 int, crash bool, pred0 func(*Prog, int) bool)
if pred(p, callIndex0) {
p0 = p
return true
- } else {
- a.Val = v0
}
+ a.Val = v0
case *ResourceType:
if crash {
return false
@@ -140,10 +139,9 @@ func Minimize(p0 *Prog, callIndex0 int, crash bool, pred0 func(*Prog, int) bool)
if pred(p, callIndex0) {
p0 = p
return true
- } else {
- a.Res = r0
- a.Val = 0
}
+ a.Res = r0
+ a.Val = 0
case *BufferType:
// TODO: try to set individual bytes to 0
if triedPaths[path] {