[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dict-tree 6544152 139/154: Fix bug causing dictree--do-
From: |
Stefan Monnier |
Subject: |
[elpa] externals/dict-tree 6544152 139/154: Fix bug causing dictree--do-query to fail to use cached results. |
Date: |
Mon, 14 Dec 2020 12:22:02 -0500 (EST) |
branch: externals/dict-tree
commit 65441522a0d8c76df04ffcb90b3d3c8b03dcd0f3
Author: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Commit: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Fix bug causing dictree--do-query to fail to use cached results.
---
dict-tree.el | 54 +++++++++++++++++++++++++++---------------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/dict-tree.el b/dict-tree.el
index dda7c95..415e24b 100644
--- a/dict-tree.el
+++ b/dict-tree.el
@@ -2567,33 +2567,33 @@ to its constituent dicts."
(when (and maxnum
(or (null (dictree--cache-maxnum cache-entry))
(> (dictree--cache-maxnum cache-entry) maxnum)))
- (setq res (setcdr (nthcdr (1- maxnum) res) nil))))
-
- ;; if there was nothing useful in the cache, do query and time it
- (let ((time (float-time)))
- (setq res
- (dictree--do-query
- dic triefun stackfun arg auxargs rankfun maxnum reverse
- (when filter (dictree--wrap-filter filter))
- stack-rankfun))
- (setq time (- (float-time) time))
- ;; if we're above the dictionary's cache threshold, cache the result
- (when (and cachefun (not no-cache)
- (or (symbolp rank-function)
- ;; can be '(t . rankfun) for `dictree-fuzzy-complete'
- (and (consp rank-function)
- (symbolp (car rank-function))
- (symbolp (cdr rank-function))))
- (symbolp filter)
- (dictree--above-cache-threshold-p
- time (length arg) (dictree-cache-policy dic)
- (dictree-cache-threshold dic) cache-long))
- (setf (dictree-modified dic) t)
- ;; create query cache if it doesn't already exist
- (funcall cachecreatefun dic)
- (puthash (list arg auxargs rank-function reverse filter)
- (dictree--cache-create res maxnum)
- (funcall cachefun dic))))
+ (setq res (setcdr (nthcdr (1- maxnum) res) nil)))
+
+ ;; if there was nothing useful in the cache, do query and time it
+ (let ((time (float-time)))
+ (setq res
+ (dictree--do-query
+ dic triefun stackfun arg auxargs rankfun maxnum reverse
+ (when filter (dictree--wrap-filter filter))
+ stack-rankfun))
+ (setq time (- (float-time) time))
+ ;; if we're above the dictionary's cache threshold, cache the result
+ (when (and cachefun (not no-cache)
+ (or (symbolp rank-function)
+ ;; can be '(t . rankfun) for `dictree-fuzzy-complete'
+ (and (consp rank-function)
+ (symbolp (car rank-function))
+ (symbolp (cdr rank-function))))
+ (symbolp filter)
+ (dictree--above-cache-threshold-p
+ time (length arg) (dictree-cache-policy dic)
+ (dictree-cache-threshold dic) cache-long))
+ (setf (dictree-modified dic) t)
+ ;; create query cache if it doesn't already exist
+ (funcall cachecreatefun dic)
+ (puthash (list arg auxargs rank-function reverse filter)
+ (dictree--cache-create res maxnum)
+ (funcall cachefun dic)))))
;; merge new result into results list
(setq results
- [elpa] externals/dict-tree 4b3cc3c 122/154: Do lexbind test at compile-time instead of load-time., (continued)
- [elpa] externals/dict-tree 4b3cc3c 122/154: Do lexbind test at compile-time instead of load-time., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree a4b2a1b 126/154: Improve edebug pretty-printing., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree b7173e8 152/154: Fix lexical binding bugs., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 3a4d3f1 015/154: Added dictree-mapcar function; code tidying., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 1dde6e1 030/154: Define missing setf methods for data cells, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 3969702 125/154: Tidy up unnecessary macros by making them into defsubst or defun., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 74c792c 111/154: Add page breaks., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 5cf96da 123/154: Implement iterator generators on collection data structures., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 913c84b 129/154: Fix bug in dictree-unload., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 1e5b3f6 130/154: Fix bug in dictree--wrap-fuzzy-rankfun wrapping., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 6544152 139/154: Fix bug causing dictree--do-query to fail to use cached results.,
Stefan Monnier <=
- [elpa] externals/dict-tree 9242ff7 154/154: * dict-tree/dict-tree.el: Fix typo in Package-Requires., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 1d096b1 141/154: Myriad bug fixes and code refactoring in new fuzzy and ngram completion., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 572c746 149/154: Fix byte-compilation errors and warnings., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 3ddde93 143/154: Switch to keyword arguments for trie/dictree query functions., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 1030ae2 071/154: Require advice when compiling, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 7a51b21 083/154: Fixed dictree--update-cache to work for lists of prefixes., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 50ae73e 085/154: Fixed bug in Read-Dict preventing completion on dict files in load-path., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree bc5724e 080/154: Minor bug-fixes to [trie/dict-tree]--edebug-pretty-print, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree f0396a0 087/154: Fixed bugs in synchronisation of regexp query caches., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 18ede82 089/154: Fixed minor spelling errors in docstrings., Stefan Monnier, 2020/12/14