From e7d582b55dda36e76ce4d0ce770139ca0915b7c5 Mon Sep 17 00:00:00 2001 From: Ezzno J Date: Tue, 14 Nov 2023 02:52:31 +0000 Subject: [PATCH] runtime: remove useless nil checking during init of itab Change-Id: I8ef12221e18e163b695d88f4bb8c309763341ec3 GitHub-Last-Rev: d3d4d4cb79418ccbb027a08892a95368888acbbf GitHub-Pull-Request: golang/go#64107 Reviewed-on: https://go-review.googlesource.com/c/go/+/542116 Auto-Submit: Keith Randall LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall Reviewed-by: Michael Pratt Reviewed-by: Keith Randall --- src/runtime/iface.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/runtime/iface.go b/src/runtime/iface.go index d5a181cae1..4563809a9d 100644 --- a/src/runtime/iface.go +++ b/src/runtime/iface.go @@ -225,13 +225,11 @@ imethods: pkgPath = rtyp.nameOff(x.PkgPath).Name() } if tname.IsExported() || pkgPath == ipkg { - if m != nil { - ifn := rtyp.textOff(t.Ifn) - if k == 0 { - fun0 = ifn // we'll set m.fun[0] at the end - } else { - methods[k] = ifn - } + ifn := rtyp.textOff(t.Ifn) + if k == 0 { + fun0 = ifn // we'll set m.fun[0] at the end + } else { + methods[k] = ifn } continue imethods } -- 2.44.0