From 1aaa70fddbef00672dc526c6776ad1bcf9f581a0 Mon Sep 17 00:00:00 2001 From: Kemal Zebari <60799661+kemzeb@users.noreply.github.com> Date: Fri, 2 Aug 2024 07:23:49 -0700 Subject: [PATCH] Remove unused code from models/repos/release.go (#31756) These blocks aren't used anywhere else when doing a grep search. (cherry picked from commit 0e3d8f80486be11ff53bdd9030a8b32d4f477d19) --- models/repo/release.go | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/models/repo/release.go b/models/repo/release.go index 075e287174..e2cd7d7ed3 100644 --- a/models/repo/release.go +++ b/models/repo/release.go @@ -413,32 +413,6 @@ func GetReleaseAttachments(ctx context.Context, rels ...*Release) (err error) { return err } -type releaseSorter struct { - rels []*Release -} - -func (rs *releaseSorter) Len() int { - return len(rs.rels) -} - -func (rs *releaseSorter) Less(i, j int) bool { - diffNum := rs.rels[i].NumCommits - rs.rels[j].NumCommits - if diffNum != 0 { - return diffNum > 0 - } - return rs.rels[i].CreatedUnix > rs.rels[j].CreatedUnix -} - -func (rs *releaseSorter) Swap(i, j int) { - rs.rels[i], rs.rels[j] = rs.rels[j], rs.rels[i] -} - -// SortReleases sorts releases by number of commits and created time. -func SortReleases(rels []*Release) { - sorter := &releaseSorter{rels: rels} - sort.Sort(sorter) -} - // UpdateReleasesMigrationsByType updates all migrated repositories' releases from gitServiceType to replace originalAuthorID to posterID func UpdateReleasesMigrationsByType(ctx context.Context, gitServiceType structs.GitServiceType, originalAuthorID string, posterID int64) error { _, err := db.GetEngine(ctx).Table("release").