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

This commit is contained in:
jguer committed 2021-10-28 17:41:51 +02:00
1 parent 57a9630054
commit 15d91e4661
2 files changed
+5 -7

No files matched your search

+1 -1
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
+4 -6
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 {