mirror of
https://github.com/golang/go
synced 2024-11-19 17:44:43 -07:00
cmd/cgo: remove unnecessary nil check
commentText is only called if g != nil in ParseGo, so the check inside commentText is redundant and can be deleted. Change-Id: I130c18b738527c96bc59950b354a50b9e23f92e9 Reviewed-on: https://go-review.googlesource.com/74871 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
f265f5db5d
commit
235a25c302
@ -144,9 +144,6 @@ func (f *File) ParseGo(name string, src []byte) {
|
||||
// Like ast.CommentGroup's Text method but preserves
|
||||
// leading blank lines, so that line numbers line up.
|
||||
func commentText(g *ast.CommentGroup) string {
|
||||
if g == nil {
|
||||
return ""
|
||||
}
|
||||
var pieces []string
|
||||
for _, com := range g.List {
|
||||
c := com.Text
|
||||
|
Loading…
Reference in New Issue
Block a user