Skip to content

Commit

Permalink
chore: use copy(to, from) instead of a loop (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored Jul 21, 2023
1 parent c103a15 commit 390547f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions reviser/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ func fixCommentGroup(commentGroup *ast.CommentGroup) *ast.CommentGroup {
List: make([]*ast.Comment, len(commentGroup.List)),
}

for i, comment := range commentGroup.List {
formattedDoc.List[i] = comment
}
copy(formattedDoc.List, commentGroup.List)

return formattedDoc
}
Expand Down

0 comments on commit 390547f

Please sign in to comment.