Commit 66121ce8 authored by Erik Staab's avatar Erik Staab Committed by Brad Fitzpatrick

runtime: remove redundant expression from SetFinalizer

The previous if condition already checks the same expression and doesn't
have side effects.

Change-Id: Ieaf30a786572b608d0a883052b45fd3f04bc6147
Reviewed-on: https://go-review.googlesource.com/28475Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 5514332e
......@@ -352,7 +352,7 @@ func SetFinalizer(obj interface{}, finalizer interface{}) {
if ft.dotdotdot() {
throw("runtime.SetFinalizer: cannot pass " + etyp.string() + " to finalizer " + ftyp.string() + " because dotdotdot")
}
if ft.dotdotdot() || ft.inCount != 1 {
if ft.inCount != 1 {
throw("runtime.SetFinalizer: cannot pass " + etyp.string() + " to finalizer " + ftyp.string())
}
fint := ft.in()[0]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment