Skip to content

Commit e89e96a

Browse files
harryzcydelvh
andcommitted
Apply suggestions from code review
Co-authored-by: delvh <[email protected]>
1 parent 91c1f69 commit e89e96a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

routers/api/v1/repo/pull.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ func CreatePullRequest(ctx *context.APIContext) {
326326
return
327327
}
328328

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

341-
orgLabelIDs := make([]int64, len(form.Labels))
342-
for i, orgLabel := range orgLabels {
343-
orgLabelIDs[i] = orgLabel.ID
341+
orgLabelIDs := make([]int64, 0, len(orgLabels))
342+
for _, orgLabel := range orgLabels {
343+
orgLabelIDs = append(orgLabelIDs, orgLabel.ID)
344344
}
345345
labelIDs = append(labelIDs, orgLabelIDs...)
346346
}

0 commit comments

Comments
 (0)