Skip to content

Commit 0e3d8f8

Browse files
authored
Remove unused code from models/repos/release.go (#31756)
These blocks aren't used anywhere else when doing a grep search.
1 parent 687c118 commit 0e3d8f8

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

models/repo/release.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -398,32 +398,6 @@ func GetReleaseAttachments(ctx context.Context, rels ...*Release) (err error) {
398398
return err
399399
}
400400

401-
type releaseSorter struct {
402-
rels []*Release
403-
}
404-
405-
func (rs *releaseSorter) Len() int {
406-
return len(rs.rels)
407-
}
408-
409-
func (rs *releaseSorter) Less(i, j int) bool {
410-
diffNum := rs.rels[i].NumCommits - rs.rels[j].NumCommits
411-
if diffNum != 0 {
412-
return diffNum > 0
413-
}
414-
return rs.rels[i].CreatedUnix > rs.rels[j].CreatedUnix
415-
}
416-
417-
func (rs *releaseSorter) Swap(i, j int) {
418-
rs.rels[i], rs.rels[j] = rs.rels[j], rs.rels[i]
419-
}
420-
421-
// SortReleases sorts releases by number of commits and created time.
422-
func SortReleases(rels []*Release) {
423-
sorter := &releaseSorter{rels: rels}
424-
sort.Sort(sorter)
425-
}
426-
427401
// UpdateReleasesMigrationsByType updates all migrated repositories' releases from gitServiceType to replace originalAuthorID to posterID
428402
func UpdateReleasesMigrationsByType(ctx context.Context, gitServiceType structs.GitServiceType, originalAuthorID string, posterID int64) error {
429403
_, err := db.GetEngine(ctx).Table("release").

0 commit comments

Comments
 (0)