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

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

[elpa] master fd46405 09/92: Fixed recursion problem


From: Alexey Veretennikov
Subject: [elpa] master fd46405 09/92: Fixed recursion problem
Date: Thu, 11 Jun 2015 19:47:50 +0000

branch: master
commit fd4640566fbccc58a452611517ad715c3f159e14
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>

    Fixed recursion problem
---
 ztree.el |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/ztree.el b/ztree.el
index 3933939..4391b95 100644
--- a/ztree.el
+++ b/ztree.el
@@ -104,10 +104,11 @@
 
 (defun ztree-find (where which)
   "find element of the list `where` matching predicate `which`"
-  (if where
-      (if (funcall which (car where))
-          (car where)
-        (ztree-find (cdr where) which))))
+  (catch 'found
+    (dolist (elt where)
+      (when (funcall which elt)
+        (throw 'found elt)))
+    nil))
 
 (defun ztree-filter (condp lst)
   "Filter out elements of the list `lst` not satisfying predicate `condp`.



reply via email to

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