branch: externals/dict-tree commit 6b05d61eb4f5f97b9c7cb3093c6395472d92d86c Author: Toby Cubitt <toby-predict...@dr-qubit.org> Commit: tsc25 <toby-predict...@dr-qubit.org>
Another bug-fix to the new cache policy code --- dict-tree.el | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/dict-tree.el b/dict-tree.el index f6ced34..aed4814 100644 --- a/dict-tree.el +++ b/dict-tree.el @@ -1751,9 +1751,9 @@ Returns nil if the stack is empty." (or (null (dictree--cache-maxnum cache)) (> (dictree--cache-maxnum cache) maxnum))) (setcdr (nthcdr (1- maxnum) completions) nil))) - - ;; if there was nothing useful in the cache, do query and time it - (t + + + (t ;; if there was nothing useful in the cache, do query and time it (let (time) (setq time (float-time)) (setq cmpl (dictree--do-query @@ -1766,12 +1766,12 @@ Returns nil if the stack is empty." (or (eq (dictree--query-cacheparam query-type dic rank-function) t) - (and (or (eq (dictree-cache-policy dict) 'time) - (eq (dictree-cache-policy dict) 'both)) + (and (or (eq (dictree-cache-policy dic) 'time) + (eq (dictree-cache-policy dic) 'both)) (>= time (dictree--query-cacheparam query-type dic rank-function))) - (and (or (eq (dictree-cache-policy dict) 'length) - (eq (dictree-cache-policy dict) 'both)) + (and (or (eq (dictree-cache-policy dic) 'length) + (eq (dictree-cache-policy dic) 'both)) ;; note: we cache completions of *shorter* keys, ;; because those are likely to be slower (<= (length arg) @@ -1793,8 +1793,7 @@ Returns nil if the stack is empty." `(trie-construct-sortfun ,(dictree-comparison-function (car dict))))) (car a) (car b)))) - nil maxnum)) - ) + nil maxnum))) completions))