emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/dict-tree 6b05d61 025/154: Another bug-fix to the new c


From: Stefan Monnier
Subject: [elpa] externals/dict-tree 6b05d61 025/154: Another bug-fix to the new cache policy code
Date: Mon, 14 Dec 2020 12:21:37 -0500 (EST)

branch: externals/dict-tree
commit 6b05d61eb4f5f97b9c7cb3093c6395472d92d86c
Author: Toby Cubitt <toby-predictive@dr-qubit.org>
Commit: tsc25 <toby-predictive@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))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]