Commit 235a25c3 authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

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: 's avatarIan Lance Taylor <iant@golang.org>
parent f265f5db
...@@ -144,9 +144,6 @@ func (f *File) ParseGo(name string, src []byte) { ...@@ -144,9 +144,6 @@ func (f *File) ParseGo(name string, src []byte) {
// Like ast.CommentGroup's Text method but preserves // Like ast.CommentGroup's Text method but preserves
// leading blank lines, so that line numbers line up. // leading blank lines, so that line numbers line up.
func commentText(g *ast.CommentGroup) string { func commentText(g *ast.CommentGroup) string {
if g == nil {
return ""
}
var pieces []string var pieces []string
for _, com := range g.List { for _, com := range g.List {
c := com.Text c := com.Text
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment