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

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

[elpa] externals/el-search 9f400b4 234/332: * el-search/el-search.el: Fi


From: Stefan Monnier
Subject: [elpa] externals/el-search 9f400b4 234/332: * el-search/el-search.el: Fix infloop in el-search--flatten-tree
Date: Tue, 1 Dec 2020 15:48:52 -0500 (EST)

branch: externals/el-search
commit 9f400b4f9084bf004ddeec2bc424693bfb121170
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>

    * el-search/el-search.el: Fix infloop in el-search--flatten-tree
    
    This fixes `el-search--flatten-tree' inflooping in cases like
    
      (el-search--flatten-tree '(x . #1=(y . #1#)))
    
    (el-search--flatten-tree): Be more strict in adding objects to the
    WALKED-OBJECTS hash-table.
---
 el-search.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/el-search.el b/el-search.el
index e9b70f2..b65bd9e 100644
--- a/el-search.el
+++ b/el-search.el
@@ -1299,7 +1299,9 @@ PATTERN and combining the heuristic matchers of the 
subpatterns."
                                   (while (consp object)
                                     (walker (car object))
                                     (setq object (cdr object))
-                                    (when (gethash object walked-objects) 
(setq object nil)))
+                                    (if (gethash object walked-objects)
+                                        (setq object nil)
+                                      (puthash object t walked-objects)))
                                   (when object ;dotted list
                                     (walker object)))
                               (cl-loop for elt being the elements of object do 
(walker elt)))))))



reply via email to

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