Merge pull request #2234 from XD-DENG/stringsbuilder
Use strings.Builder for more efficient string concatenation
This commit is contained in:
commit
4b395c5dd2
1 changed files with 3 additions and 3 deletions
|
|
@ -502,11 +502,11 @@ func computeDefaults(baseRef, headRef string) (shared.Defaults, error) {
|
|||
} else {
|
||||
out.Title = utils.Humanize(headRef)
|
||||
|
||||
body := ""
|
||||
var body strings.Builder
|
||||
for i := len(commits) - 1; i >= 0; i-- {
|
||||
body += fmt.Sprintf("- %s\n", commits[i].Title)
|
||||
fmt.Fprintf(&body, "- %s\n", commits[i].Title)
|
||||
}
|
||||
out.Body = body
|
||||
out.Body = body.String()
|
||||
}
|
||||
|
||||
return out, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue