]> Cypherpunks repositories - gostls13.git/commitdiff
go/doc cleanup: remove some unnecessary string conversions
authorRobert Griesemer <gri@golang.org>
Thu, 18 Mar 2010 21:09:17 +0000 (14:09 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 18 Mar 2010 21:09:17 +0000 (14:09 -0700)
R=rsc
CC=golang-dev
https://golang.org/cl/642041

src/pkg/go/doc/doc.go

index 5479743bae2e1e0d90d45eec1c3bc40e4b02d095..5ff3eafa6d0bf8068e4b96bc1956aad619f1599c 100644 (file)
@@ -292,10 +292,9 @@ func (doc *docReader) addFile(src *ast.File) {
        // collect BUG(...) comments
        for _, c := range src.Comments {
                text := c.List[0].Text
-               cstr := string(text)
-               if m := bug_markers.ExecuteString(cstr); len(m) > 0 {
+               if m := bug_markers.Execute(text); len(m) > 0 {
                        // found a BUG comment; maybe empty
-                       if bstr := cstr[m[1]:]; bug_content.MatchString(bstr) {
+                       if btxt := text[m[1]:]; bug_content.Match(btxt) {
                                // non-empty BUG comment; collect comment without BUG prefix
                                list := copyCommentList(c.List)
                                list[0].Text = text[m[1]:]