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...))
if sortMode == settings.BottomUp {
s = sort.Reverse(s).(repoQuery)
s.Reverse()
}
return s

View File

@ -24,12 +24,10 @@ type aurSortable struct {
sortMode int
}
func (r repoQuery) Len() int {
return len(r)
}
func (r repoQuery) Swap(i, j int) {
r[i], r[j] = r[j], r[i]
func (r repoQuery) Reverse() {
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) Less(i, j int) bool {