More refactoring on pacman

This commit is contained in:
Jguer 2017-05-08 18:19:58 +01:00
parent c06b55d6f1
commit 66c4a31b71

View File

@ -21,25 +21,24 @@ func Search(pkgInputN []string) (s Query, n int, err error) {
// BottomUp functions
initL := func(len int) int {
return len - 1
if config.YayConf.SortMode == config.TopDown {
return 0
} else {
return len - 1
}
}
compL := func(len int, i int) bool {
return i > -1
if config.YayConf.SortMode == config.TopDown {
return i < len
} else {
return i > -1
}
}
finalL := func(i int) int {
return i - 1
}
// TopDown functions
if config.YayConf.SortMode == config.TopDown {
initL = func(len int) int {
return 0
}
compL = func(len int, i int) bool {
return i < len
}
finalL = func(i int) int {
if config.YayConf.SortMode == config.TopDown {
return i + 1
} else {
return i - 1
}
}