Reduce some allocations in type conversion (#26772)

This commit is contained in:
Chongyi Zheng authored and GitHub committed 2023-08-29 00:43:16 +08:00
1 parent 4803766f7a
commit ac2f8c9ac6
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -755,11 +755,11 @@ func GetSquashMergeCommitMessages(ctx context.Context, pr *issues_model.PullRequ
}
for _, author := range authors {
if _, err := stringBuilder.Write([]byte("Co-authored-by: ")); err != nil {
if _, err := stringBuilder.WriteString("Co-authored-by: "); err != nil {
log.Error("Unable to write to string builder Error: %v", err)
return ""
}
if _, err := stringBuilder.Write([]byte(author)); err != nil {
if _, err := stringBuilder.WriteString(author); err != nil {
log.Error("Unable to write to string builder Error: %v", err)
return ""
}