]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove nil check for p in isReflectPkg
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Mon, 20 Apr 2020 03:55:02 +0000 (10:55 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Mon, 20 Apr 2020 05:15:24 +0000 (05:15 +0000)
CL 228859 refactored detecting reflect package logic in to isReflectPkg
function. The function has un-necessary nil check for p, so remove that
check.

Passes toolstash-check.

Change-Id: I2f3f1ac967fe8d176dda3f3b4698ded08602e2fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/228861
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/go.go

index 758c90931ff358debc3a6807fc726a8400c00fad..9079ce2afc4198e8d4af882103022517d3ee1b51 100644 (file)
@@ -47,10 +47,6 @@ func isRuntimePkg(p *types.Pkg) bool {
 
 // isReflectPkg reports whether p is package reflect.
 func isReflectPkg(p *types.Pkg) bool {
-       // TODO(cuonglm): how to get rid this check.
-       if p == nil {
-               return false
-       }
        if p == localpkg {
                return myimportpath == "reflect"
        }