changeset 93821:882bd14c76fc

(cvs-map): Avoid recursion :-(
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 07 Apr 2008 14:25:02 +0000
parents 7c273495693a
children ac3c073bf1c2
files lisp/ChangeLog lisp/pcvs-util.el
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Apr 07 13:08:33 2008 +0000
+++ b/lisp/ChangeLog	Mon Apr 07 14:25:02 2008 +0000
@@ -1,3 +1,7 @@
+2008-04-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* pcvs-util.el (cvs-map): Avoid recursion :-(
+
 2008-04-07  Glenn Morris  <rgm@gnu.org>
 
 	* calendar/calendar.el (calendar-mode-map): Replace use of kbd.
--- a/lisp/pcvs-util.el	Mon Apr 07 13:08:33 2008 +0000
+++ b/lisp/pcvs-util.el	Mon Apr 07 14:25:02 2008 +0000
@@ -51,9 +51,11 @@
       (unless (member x ys) (push x zs)))))
 
 (defun cvs-map (-cvs-map-f &rest -cvs-map-ls)
-  (unless (cvs-every 'null -cvs-map-ls)
-    (cons (apply -cvs-map-f (mapcar 'car -cvs-map-ls))
-	  (apply 'cvs-map -cvs-map-f (mapcar 'cdr -cvs-map-ls)))))
+  (let ((accum ()))
+    (while (not (cvs-every 'null -cvs-map-ls))
+      (push (apply -cvs-map-f (mapcar 'car -cvs-map-ls)) accum)
+      (setq -cvs-map-ls (mapcar 'cdr -cvs-map-ls)))
+    (nreverse accum)))
 
 (defun cvs-first (l &optional n)
   (if (null n) (car l)