[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/trie f676ea0 091/111: Fix off-by-1 bug in Lewenstein di
From: |
Stefan Monnier |
Subject: |
[elpa] externals/trie f676ea0 091/111: Fix off-by-1 bug in Lewenstein distance queries. |
Date: |
Mon, 14 Dec 2020 11:35:27 -0500 (EST) |
branch: externals/trie
commit f676ea0b2b8f14d2a1c37ec29da52f6cf6188959
Author: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Commit: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Fix off-by-1 bug in Lewenstein distance queries.
---
trie.el | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/trie.el b/trie.el
index abdea89..6d4befc 100644
--- a/trie.el
+++ b/trie.el
@@ -2209,7 +2209,7 @@ of the default key-dist-data list."
row string (trie--node-split node) equalfun)
seq (trie--seq-append seq (trie--node-split node)))
- ;; as long as some row entry is < DISTANCE, recursively search below NODE
+ ;; as long as some row entry is <= DISTANCE, recursively search below NODE
(when (<= (apply #'min (append row nil)) distance)
(funcall mapfun
(lambda (n)
@@ -2311,7 +2311,7 @@ STRING."
row string (trie--node-split node) equalfun))
;; push children of non-data nodes whose SEQ is less than DISTANCE
;; onto stack
- (when (< (apply #'min (append row nil)) distance)
+ (when (<= (apply #'min (append row nil)) distance)
(push
(list (trie--seq-append seq (trie--node-split node))
(funcall stack-createfun
@@ -2493,7 +2493,7 @@ of the default key-dist-data list."
pfxlen (length seq)))
;; as long as some row entry is < DISTANCE, recursively search below NODE
- (if (< (apply #'min (append row nil)) distance)
+ (if (<= (apply #'min (append row nil)) distance)
(funcall mapfun
(lambda (n)
(trie--do-fuzzy-complete
@@ -2634,9 +2634,9 @@ give meaningful results; use `trie-complete-stack'
instead.)"
prefix t row pfxcost pfxlen)
store))
- ;; if some row entry for non-data node is < DISTANCE, push node
+ ;; if some row entry for non-data node is <= DISTANCE, push node
;; onto stack
- ((< (apply #'min (append row nil)) distance)
+ ((<= (apply #'min (append row nil)) distance)
(push
(list seq
(funcall stack-createfun
- [elpa] externals/trie 9986ac7 068/111: Restore trie print/read transformer functions., (continued)
- [elpa] externals/trie 9986ac7 068/111: Restore trie print/read transformer functions., Stefan Monnier, 2020/12/14
- [elpa] externals/trie ec5396c 071/111: Suppress bogus unused lexical variable byte-compiler warnings., Stefan Monnier, 2020/12/14
- [elpa] externals/trie acad8e8 050/111: Bug-fixes to edebug advice, Stefan Monnier, 2020/12/14
- [elpa] externals/trie 15b4de9 018/111: Simplified trie--create by storing functions for predefined trie types in symbol property lists, Stefan Monnier, 2020/12/14
- [elpa] externals/trie fb1d096 034/111: Changed trie-wildcard-match to return grouping data if pattern matches and contains groups, Stefan Monnier, 2020/12/14
- [elpa] externals/trie 4ff2b48 057/111: Minor typo-fixes in docstrings., Stefan Monnier, 2020/12/14
- [elpa] externals/trie a8bc50f 041/111: Minor code tidying, Stefan Monnier, 2020/12/14
- [elpa] externals/trie 0d81a80 066/111: Remove dependency on Emacs version, since this is currently broken in ELPA., Stefan Monnier, 2020/12/14
- [elpa] externals/trie 673ca83 013/111: Don't compile wrapped functions explicitly, Stefan Monnier, 2020/12/14
- [elpa] externals/trie db78411 107/111: Switch to keyword arguments for trie/dictree query functions., Stefan Monnier, 2020/12/14
- [elpa] externals/trie f676ea0 091/111: Fix off-by-1 bug in Lewenstein distance queries.,
Stefan Monnier <=
- [elpa] externals/trie eef13c4 079/111: Document fuzzy matching functions and bump version number., Stefan Monnier, 2020/12/14
- [elpa] externals/trie 77aafc9 108/111: Fix byte-compilation errors and warnings., Stefan Monnier, 2020/12/14
- [elpa] externals/trie b6ba36b 002/111: Minor improvements to trie-complete[-ordered], Stefan Monnier, 2020/12/14
- [elpa] externals/trie 503b286 004/111: Make bare avl trees which don't store cmpfun with tree, Stefan Monnier, 2020/12/14
- [elpa] externals/trie 0162b74 003/111: Added trie-stacks implementation., Stefan Monnier, 2020/12/14
- [elpa] externals/trie 45569c2 007/111: Added optional TEST function to trie-delete, Stefan Monnier, 2020/12/14
- [elpa] externals/trie 45accae 019/111: Bug-fix in trie--do-delete, Stefan Monnier, 2020/12/14
- [elpa] externals/trie 4f11b37 022/111: Docstring, change log, and version number updates, Stefan Monnier, 2020/12/14
- [elpa] externals/trie 510844e 035/111: trivial variable name change, Stefan Monnier, 2020/12/14
- [elpa] externals/trie 4b24754 008/111: Converted function wrapping macros into functions, Stefan Monnier, 2020/12/14