Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: delvh <dev.lh@web.de>
  • Loading branch information
harryzcy and delvh committed Aug 28, 2023
1 parent 91c1f69 commit e89e96a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions routers/api/v1/repo/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func CreatePullRequest(ctx *context.APIContext) {
return
}

labelIDs = make([]int64, 0, len(form.Labels))
labelIDs = make([]int64, 0, len(labels))
for _, label := range labels {
labelIDs = append(labelIDs, label.ID)
}
Expand All @@ -338,9 +338,9 @@ func CreatePullRequest(ctx *context.APIContext) {
return
}

orgLabelIDs := make([]int64, len(form.Labels))
for i, orgLabel := range orgLabels {
orgLabelIDs[i] = orgLabel.ID
orgLabelIDs := make([]int64, 0, len(orgLabels))
for _, orgLabel := range orgLabels {
orgLabelIDs = append(orgLabelIDs, orgLabel.ID)
}
labelIDs = append(labelIDs, orgLabelIDs...)
}
Expand Down

0 comments on commit e89e96a

Please sign in to comment.