+4
-8
appview/db/pulls.go
+4
-8
appview/db/pulls.go
···
400
400
submission_id
401
401
`, inClause)
402
402
403
-
args = make([]any, len(pulls))
404
-
idx = 0
403
+
args = make([]any, 0, len(pulls))
405
404
for _, p := range pulls {
406
-
args[idx] = p.Submissions[p.LastRoundNumber()].ID
407
-
idx += 1
405
+
args = append(args, p.Submissions[p.LastRoundNumber()].ID)
408
406
}
409
407
commentsRows, err := e.Query(commentsQuery, args...)
410
408
if err != nil {
···
429
427
return nil, err
430
428
}
431
429
432
-
orderedByDate := make([]*Pull, len(pulls))
433
-
idx = 0
430
+
orderedByDate := make([]*Pull, 0, len(pulls))
434
431
for _, p := range pulls {
435
-
orderedByDate[idx] = p
436
-
idx += 1
432
+
orderedByDate = append(orderedByDate, p)
437
433
}
438
434
sort.Slice(orderedByDate, func(i, j int) bool {
439
435
return orderedByDate[i].Created.After(orderedByDate[j].Created)