Skip to content

Commit 111d31d

Browse files
authored
don't convert buffer to string (#7115)
1 parent 09ca391 commit 111d31d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/issue_comment.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ func CreateCodeComment(doer *User, repo *Repository, issue *Issue, content, tree
910910
if err := GetRawDiffForFile(gitRepo.Path, pr.MergeBase, headCommitID, RawDiffNormal, treePath, patchBuf); err != nil {
911911
return nil, fmt.Errorf("GetRawDiffForLine[%s, %s, %s, %s]: %v", err, gitRepo.Path, pr.MergeBase, headCommitID, treePath)
912912
}
913-
patch = CutDiffAroundLine(strings.NewReader(patchBuf.String()), int64((&Comment{Line: line}).UnsignedLine()), line < 0, setting.UI.CodeCommentLines)
913+
patch = CutDiffAroundLine(patchBuf, int64((&Comment{Line: line}).UnsignedLine()), line < 0, setting.UI.CodeCommentLines)
914914
}
915915
return CreateComment(&CreateCommentOptions{
916916
Type: CommentTypeCode,

0 commit comments

Comments
 (0)