From 688fcf90ffbe0dfb01394cb40ee8840227416a79 Mon Sep 17 00:00:00 2001 From: hmurata Date: Fri, 10 Feb 2006 12:42:47 +0000 Subject: [PATCH] (elmo-flatten): Don't use recursive call. --- elmo/ChangeLog | 2 ++ elmo/elmo-util.el | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index fae09f3..81e79c1 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,7 @@ 2006-02-10 Hiroya Murata + * elmo-util.el (elmo-flatten): Don't use recursive call. + * elmo-search.el (elmo-folder-msgdb-create): Remove an unnecessary assignment. (elmo-folder-message-make-temp-files): Use `number-to-string' diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 70bfef7..7a60871 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -1307,12 +1307,11 @@ SPEC is a list as followed (LABEL MAX-VALUE [FORMAT])." (defun elmo-flatten (list-of-list) "Flatten LIST-OF-LIST." - (unless (null list-of-list) - (append (if (and (car list-of-list) - (listp (car list-of-list))) - (car list-of-list) - (list (car list-of-list))) - (elmo-flatten (cdr list-of-list))))) + (if list-of-list + (apply #'nconc + (mapcar (lambda (element) + (if (consp element) element (list element))) + list-of-list)))) (defun elmo-y-or-n-p (prompt &optional auto default) "Same as `y-or-n-p'. -- 1.7.10.4