Commit 7f775183 authored by Robert Griesemer's avatar Robert Griesemer

go/doc cleanup: remove some unnecessary string conversions

R=rsc
CC=golang-dev
https://golang.org/cl/642041
parent 8c24fa95
...@@ -292,10 +292,9 @@ func (doc *docReader) addFile(src *ast.File) { ...@@ -292,10 +292,9 @@ func (doc *docReader) addFile(src *ast.File) {
// collect BUG(...) comments // collect BUG(...) comments
for _, c := range src.Comments { for _, c := range src.Comments {
text := c.List[0].Text text := c.List[0].Text
cstr := string(text) if m := bug_markers.Execute(text); len(m) > 0 {
if m := bug_markers.ExecuteString(cstr); len(m) > 0 {
// found a BUG comment; maybe empty // 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 // non-empty BUG comment; collect comment without BUG prefix
list := copyCommentList(c.List) list := copyCommentList(c.List)
list[0].Text = text[m[1]:] list[0].Text = text[m[1]:]
......
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