From 66121ce8a95f587be8641f79c66c8536660a16d5 Mon Sep 17 00:00:00 2001 From: Erik Staab Date: Sat, 3 Sep 2016 15:57:48 -0700 Subject: [PATCH] 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/28475 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/runtime/mfinal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/mfinal.go b/src/runtime/mfinal.go index 14ebec81bf..9bad6f0aa3 100644 --- a/src/runtime/mfinal.go +++ b/src/runtime/mfinal.go @@ -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] -- 2.48.1