summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2014-02-02 21:41:08 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2014-02-02 21:41:08 +0900
commit089691faaf9a470847dc4c06824b8f7b219da195 (patch)
treea27db4f88a686cd89dbc62cea949e2ccdeda8cd8
parent301290663d69dd451d18237c98f6bb7ed19d1834 (diff)
Cache the result as sorted
-rwxr-xr-xfzf10
1 files changed, 5 insertions, 5 deletions
diff --git a/fzf b/fzf
index d29f0b35..2922e4cf 100755
--- a/fzf
+++ b/fzf
@@ -642,11 +642,11 @@ class FZF
matcher.match(list, q, q[0, cx], q[cx..-1]))
end
next if skip
- matches = fcache[q] = @sort ? found : found.reverse
- end
-
- if !empty && @sort && matches.length <= @sort
- matches = sort_by_rank(matches)
+ matches = @sort ? found : found.reverse
+ if !empty && @sort && matches.length <= @sort
+ matches = sort_by_rank(matches)
+ end
+ fcache[q] = matches
end
# Atomic update