From 14cfebb986bc40cec3788be7421bb7844c167055 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 7 Apr 2008 14:25:02 +0000 Subject: (cvs-map): Avoid recursion :-( --- lisp/pcvs-util.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lisp/pcvs-util.el') diff --git a/lisp/pcvs-util.el b/lisp/pcvs-util.el index bd4efef8d55..1cbe72796c2 100644 --- a/lisp/pcvs-util.el +++ b/lisp/pcvs-util.el @@ -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) -- cgit v1.2.3