Optimize rank comparison on x86 (little-endian)

This commit is contained in:
Junegunn Choi
2017-08-26 21:58:18 +09:00
parent 159699b5d7
commit 6b4805ca1a
4 changed files with 37 additions and 18 deletions

16
src/result_others.go Normal file
View File

@@ -0,0 +1,16 @@
// +build !386,!amd64
package fzf
func compareRanks(irank Result, jrank Result, tac bool) bool {
for idx := 3; idx >= 0; idx-- {
left := irank.points[idx]
right := jrank.points[idx]
if left < right {
return true
} else if left > right {
return false
}
}
return (irank.item.Index() <= jrank.item.Index()) != tac
}