fix(search): revert repo query revert. Fixes #1623

This commit is contained in:
jguer 2021-10-28 17:41:51 +02:00
parent 57a9630054
commit 15d91e4661
No known key found for this signature in database
GPG key ID: 6D6CC9BEA8556B35
2 changed files with 5 additions and 7 deletions

View file

@ -139,7 +139,7 @@ func queryRepo(pkgInputN []string, dbExecutor db.Executor, sortMode int) repoQue
s := repoQuery(dbExecutor.SyncPackages(pkgInputN...)) s := repoQuery(dbExecutor.SyncPackages(pkgInputN...))
if sortMode == settings.BottomUp { if sortMode == settings.BottomUp {
s = sort.Reverse(s).(repoQuery) s.Reverse()
} }
return s return s

View file

@ -24,12 +24,10 @@ type aurSortable struct {
sortMode int sortMode int
} }
func (r repoQuery) Len() int { func (r repoQuery) Reverse() {
return len(r) for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 {
} r[i], r[j] = r[j], r[i]
}
func (r repoQuery) Swap(i, j int) {
r[i], r[j] = r[j], r[i]
} }
func (r repoQuery) Less(i, j int) bool { func (r repoQuery) Less(i, j int) bool {