From 6b4805ca1a1b0758363d1bb8c4c996730e19dc5a Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 26 Aug 2017 21:58:18 +0900 Subject: Optimize rank comparison on x86 (little-endian) --- src/result_others.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/result_others.go (limited to 'src/result_others.go') diff --git a/src/result_others.go b/src/result_others.go new file mode 100644 index 00000000..e3363a8e --- /dev/null +++ b/src/result_others.go @@ -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 +} -- cgit v1.2.3