]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime: remove redundant expression from SetFinalizer
authorErik Staab <estaab@google.com>
Sat, 3 Sep 2016 22:57:48 +0000 (15:57 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 6 Sep 2016 00:52:26 +0000 (00:52 +0000)
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/28475
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/mfinal.go

index 14ebec81bf37f739ebd5b8b28e31df261985ff5f..9bad6f0aa37bc75354473745526823c6c43fbfc9 100644 (file)
@@ -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]